Skip to content

REST API repeats values in JSON fields #157

Description

@mo-seph

The values in a JSON field are repeated several times in the JSON output of the rest API when querying.

Example object (shortened syntax for clarity):
{ @id: obj1, children: [ @obj2, @obj3, "extra", "extra" ] ... }

Python client returns (as expected):

u'obj1': { u'@id': u'obj1',
                        u'children': [ { u'@id': u'obj2'},
                                       { u'@id': u'obj3'},
                                       { u'@language': u'',
                                         u'@type': u'',
                                         u'@value': u'extra'},
                                       { u'@language': u'',
                                         u'@type': u'',
                                         u'@value': u'extra'}],

REST API returns:

Request: http://localhost:8211/indxtest2/query?app=INDX%2BCLIClient&box=indxtest2&token=69d4490a-efcb-11e3-a8e6-28cfe914080b&q=%7B%22%40id%22%3A%22obj1%22%7D   GET headers:

gives:

{
  "children":[{
    "@link_only":true
  },{
    "@id":"obj2",
    "@link_only":true
  },{
    "@id":"obj2",
    "@link_only":true
  },{
    "@id":"obj2",
    "@link_only":true
  },{
    "@id":"obj3"
  },{
    "@id":"obj3",
    "@link_only":true
  },{
    "@id":"obj3",
    "@link_only":true
  },{
    "@id":"obj3",
    "@link_only":true
  },{
    "@id":"obj3",
    "@link_only":true
  },{
    "@type":"",
    "@value":"extra",
    "@language":""
  },{
    "@type":"",
    "@value":"extra",
    "@language":""
  },{
    "@type":"",
    "@value":"extra",
    "@language":""
  },{
    "@type":"",
    "@value":"extra",
    "@language":""
  },{
    "@type":"",
    "@value":"extra",
    "@language":""
  },{
    "@type":"",
    "@value":"extra",
    "@language":""
  },{
    "@type":"",
    "@value":"extra",
    "@language":""
  },{
    "@type":"",
    "@value":"extra",
    "@language":""
  },{
    "@type":"",
    "@value":"extra",
    "@language":""
  },{
    "@type":"",
    "@value":"extra",
    "@language":""
  }],

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions