Uploaded image for project: ' Meeting Manager '
  1. Meeting Manager
  2. MEETING-512

REST structure response differe in JSON and XML

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • None
    • Docker Linux Debian
    • Unknown

    Description

      On XWiki 9.10.1 the structure of the REST answer is different between JSON or XML.

      For example for the resquest :
      .../rest/wikis/xwiki/spaces/XWiki/pages/XWikiPreferences/objects/XWiki.XWikiGlobalRights/?media=xml

      I have the answer :
      {{<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <objects xmlns="http://www.xwiki.org">
      <objectSummary>
      <link href="http://xwiki.local.in.forge.education.gouv.fr:5080/rest/wikis/xwiki/spaces/XWiki/pages/XWikiPreferences/objects/XWiki.XWikiGlobalRights/0" rel="http://www.xwiki.org/rel/object"/><link href="http://xwiki.local.in.forge.education.gouv.fr:5080/rest/wikis/xwiki/spaces/XWiki/pages/XWikiPreferences/objects/XWiki.XWikiGlobalRights/0/properties" rel="http://www.xwiki.org/rel/properties"/><id>xwiki:XWiki.XWikiPreferences:369eb46f-6311-437b-a3a1-38755f324898</id><guid>369eb46f-6311-437b-a3a1-38755f324898</guid><pageId>xwiki:XWiki.XWikiPreferences</pageId><pageVersion>91.1</pageVersion><wiki>xwiki</wiki><space>XWiki</space><pageName>XWikiPreferences</pageName><pageAuthor>XWiki.admin_1</pageAuthor><className>XWiki.XWikiGlobalRights</className><number>0</number><headline>1</headline></objectSummary><objectSummary><link href="http://xwiki.local.in.forge.education.gouv.fr:5080/rest/wikis/xwiki/spaces/XWiki/pages/XWikiPreferences/objects/XWiki.XWikiGlobalRights/1" rel="http://www.xwiki.org/rel/object"/><link href="http://xwiki.local.in.forge.education.gouv.fr:5080/rest/wikis/xwiki/spaces/XWiki/pages/XWikiPreferences/objects/XWiki.XWikiGlobalRights/1/properties" rel="http://www.xwiki.org/rel/properties"/><id>xwiki:XWiki.XWikiPreferences:e9630277-a371-4228-8659-8a1abc7bacfa</id><guid>e9630277-a371-4228-8659-8a1abc7bacfa</guid><pageId>xwiki:XWiki.XWikiPreferences</pageId><pageVersion>91.1</pageVersion><wiki>xwiki</wiki><space>XWiki</space><pageName>XWikiPreferences</pageName><pageAuthor>XWiki.admin_1</pageAuthor><className>XWiki.XWikiGlobalRights</className><number>1</number><headline>1</headline></objectSummary></objects>}}

      For the same request formated in JSON :
      .../wikis/xwiki/spaces/XWiki/pages/XWikiPreferences/objects/XWiki.XWikiGlobalRights/?media=json

      I have the answer :

      {{{"links":[],"objectSummaries":[{"links":[

      {"href":"http://xwiki.local.in.forge.education.gouv.fr:5080/rest/wikis/xwiki/spaces/XWiki/pages/XWikiPreferences/objects/XWiki.XWikiGlobalRights/0","rel":"http://www.xwiki.org/rel/object","type":null,"hrefLang":null}

      ,

      {"href":"http://xwiki.local.in.forge.education.gouv.fr:5080/rest/wikis/xwiki/spaces/XWiki/pages/XWikiPreferences/objects/XWiki.XWikiGlobalRights/0/properties","rel":"http://www.xwiki.org/rel/properties","type":null,"hrefLang":null}

      ],"id":"xwiki:XWiki.XWikiPreferences:369eb46f-6311-437b-a3a1-38755f324898","guid":"369eb46f-6311-437b-a3a1-38755f324898","pageId":"xwiki:XWiki.XWikiPreferences","pageVersion":"91.1","wiki":"xwiki","space":"XWiki","pageName":"XWikiPreferences","pageAuthor":"XWiki.admin_1","pageAuthorName":null,"className":"XWiki.XWikiGlobalRights","number":0,"headline":"1"},{"links":[

      {"href":"http://xwiki.local.in.forge.education.gouv.fr:5080/rest/wikis/xwiki/spaces/XWiki/pages/XWikiPreferences/objects/XWiki.XWikiGlobalRights/1","rel":"http://www.xwiki.org/rel/object","type":null,"hrefLang":null}

      ,

      {"href":"http://xwiki.local.in.forge.education.gouv.fr:5080/rest/wikis/xwiki/spaces/XWiki/pages/XWikiPreferences/objects/XWiki.XWikiGlobalRights/1/properties","rel":"http://www.xwiki.org/rel/properties","type":null,"hrefLang":null}

      ],"id":"xwiki:XWiki.XWikiPreferences:e9630277-a371-4228-8659-8a1abc7bacfa","guid":"e9630277-a371-4228-8659-8a1abc7bacfa","pageId":"xwiki:XWiki.XWikiPreferences","pageVersion":"91.1","wiki":"xwiki","space":"XWiki","pageName":"XWikiPreferences","pageAuthor":"XWiki.admin_1","pageAuthorName":null,"className":"XWiki.XWikiGlobalRights","number":1,"headline":"1"}]}}}

      In XML we have :
      <objects><objectSummary>...</objectSummary></objects>

      In JSON we have :
      "objectSummaries":[...]

      Regards.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Camille_D Camille Desmots
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: