Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example app manifest is invalid json #559

Open
rrowlands opened this issue Nov 17, 2020 · 2 comments
Open

Example app manifest is invalid json #559

rrowlands opened this issue Nov 17, 2020 · 2 comments

Comments

@rrowlands
Copy link

rrowlands commented Nov 17, 2020

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".

@rrowlands
Copy link
Author

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.

@larshelge
Copy link
Member

We welcome a PR to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants