Problem with json metadata import

Hi,
I’m trying to import some metadata (report favorites) through the API in json format, but I’m having some problems - only the name/object is imported, none of the associated metadata/settings.

As a test, I did the following on the demo server:

  1. exported a reporttable in json format (using detailed metadata export)

  2. removed the uid and changed the name

  3. imported it on the same server: curl -u admin:district -X POST -H «Content-Type: application/json» -d @metaData.jsonhttps://apps.dhis2.org/demo/api/reportTables

The favorite is imported, but trying to open it gives this error: «At least one dimension must be specified as row or column», and looking at the metadata I see that nothing has really been imported except the name itself.

When I do the exact same thing with XML, everything is fine. Am I doing something wrong, or is this a bug?

BTW, same thing is happening with trunk.

Olav

That sounds strange Olav, there should be no functional difference between JSON and XML (they are both parsed by the same framework).

Can you run the JSON through jsonlint.com ? just to see if there are any format issues

···


Morten

On Mon, Sep 29, 2014 at 7:31 PM, Olav Poppe olav.poppe@me.com wrote:

Hi,
I’m trying to import some metadata (report favorites) through the API in json format, but I’m having some problems - only the name/object is imported, none of the associated metadata/settings.

As a test, I did the following on the demo server:

  1. exported a reporttable in json format (using detailed metadata export)
  1. removed the uid and changed the name
  1. imported it on the same server: curl -u admin:district -X POST -H «Content-Type: application/json» -d @metaData.jsonhttps://apps.dhis2.org/demo/api/reportTables

The favorite is imported, but trying to open it gives this error: «At least one dimension must be specified as row or column», and looking at the metadata I see that nothing has really been imported except the name itself.

When I do the exact same thing with XML, everything is fine. Am I doing something wrong, or is this a bug?

BTW, same thing is happening with trunk.

Olav


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

No format issues according to jsonlint. Attaching the file here. And the result («empty» import) can be seen here: https://apps.dhis2.org/demo/api/reportTables/arzsxhJ2WnG.json

Olav