Example app manifest is invalid json
rrowlands opened this issue · 2 comments
In this documentation:
https://docs.dhis2.org/2.34/en/dhis2_developer_manual/apps.html#creating-apps
The example code for the 'manifest.webapp' file is invalid json. The "authorities" array ends with a curly bracket, when it should instead be an array bracket.
The DHIS2 server throws this error:
Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected close marker '}': expected ']' (for Array starting at [Source: (ZipFileInflaterInputStream); line: 23, column: 20])
When parsing.
This can be easily tested by pasting this example json into an online json formatter (such as https://jsonformatter.org/).
Finally, the DHIS2 server presents this message:
"Failed to install app: app could not be installed on the file system"
to the user uploading an app with this manifest file in it, which is incredibly misleading. You would expect something more like "invalid app manifest file".
Additionally, the pathing for the icons in the example json is incorrect. It should be:
"icons": {
"16": "img/icons/mortar-16.png",
"48": "img/icons/mortar-48.png",
"128": "img/icons/mortar-128.png"
},
The server does not find the image with the slash at the beginning of the path.
We welcome a PR to fix this issue.