Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-14120

Fix complex type url serialization in REST API

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.9.2
    • Fix Version/s: 5.9.3
    • Component/s: Rest API

      Description

      To reproduce: try get JSON serialization of a Picture Document:

      curl --header "X-NXDocumentProperties: picture" -u Administrator:Administrator http://localhost:8080/nuxeo/api/v1/id/8b2327e8-4497-4a65-914e-f384f6479c36
      

      We get the following. Note the url of the different picture:views, they don't work.

      {
          "changeToken": "1395767151000", 
          "contextParameters": {}, 
          "entity-type": "document", 
          "facets": [
              "Picture", 
              "Commentable", 
              "Asset", 
              "MultiviewPicture", 
              "Versionable", 
              "Publishable", 
              "HasRelatedText", 
              "Thumbnail"
          ], 
          "isCheckedOut": true, 
          "lastModified": "2014-03-25T17:05:51.00Z", 
          "path": "/asset-library/landscape10.jpg", 
          "properties": {
              "picture:byline": null, 
              "picture:caption": null, 
              "picture:credit": null, 
              "picture:cropCoords": null, 
              "picture:dateline": "Sat May 28 00:00:00 CEST 2011", 
              "picture:genre": null, 
              "picture:headline": null, 
              "picture:language": null, 
              "picture:origin": null, 
              "picture:slugline": null, 
              "picture:source": null, 
              "picture:subheadline": null, 
              "picture:typage": null, 
              "picture:views": [
                  {
                      "content": {
                          "data": "http://localhost:8080/nuxeo/nxbigfile/default/8b2327e8-4497-4a65-914e-f384f6479c36/picture:views%2F0%2Fcontent/Medium_landscape10.jpg", 
                          "digest": "fac55e7f9bd7b8e24d79d3d215ff1ac1", 
                          "encoding": null, 
                          "length": "112150", 
                          "mime-type": "image/jpeg", 
                          "name": "Medium_landscape10.jpg"
                      }, 
                      "description": "Medium Size", 
                      "filename": "Medium_landscape10.jpg", 
                      "height": "380", 
                      "tag": "medium", 
                      "title": "Medium", 
                      "width": "550"
                  }, 
                  {
                      "content": {
                          "data": "http://localhost:8080/nuxeo/nxbigfile/default/8b2327e8-4497-4a65-914e-f384f6479c36/picture:views%2F1%2Fcontent/Original_landscape10.jpg", 
                          "digest": "684c6c2863204988d44d16b595a87304", 
                          "encoding": null, 
                          "length": "317922", 
                          "mime-type": "image/jpeg", 
                          "name": "Original_landscape10.jpg"
                      }, 
                      "description": null, 
                      "filename": "Original_landscape10.jpg", 
                      "height": "708", 
                      "tag": "original", 
                      "title": "Original", 
                      "width": "1024"
                  }, 
                  {
                      "content": {
                          "data": "http://localhost:8080/nuxeo/nxbigfile/default/8b2327e8-4497-4a65-914e-f384f6479c36/picture:views%2F2%2Fcontent/Small_landscape10.jpg", 
                          "digest": "2d0e6eea560582c5375c925af6eff121", 
                          "encoding": null, 
                          "length": "37791", 
                          "mime-type": "image/jpeg", 
                          "name": "Small_landscape10.jpg"
                      }, 
                      "description": "Small Size", 
                      "filename": "Small_landscape10.jpg", 
                      "height": "193", 
                      "tag": "small", 
                      "title": "Small", 
                      "width": "280"
                  }, 
                  {
                      "content": {
                          "data": "http://localhost:8080/nuxeo/nxbigfile/default/8b2327e8-4497-4a65-914e-f384f6479c36/picture:views%2F3%2Fcontent/Thumbnail_landscape10.jpg", 
                          "digest": "365dbf9285764a56a9eb0a7de80c0890", 
                          "encoding": null, 
                          "length": "9000", 
                          "mime-type": "image/jpeg", 
                          "name": "Thumbnail_landscape10.jpg"
                      }, 
                      "description": "Thumbnail Size", 
                      "filename": "Thumbnail_landscape10.jpg", 
                      "height": "69", 
                      "tag": "thumb", 
                      "title": "Thumbnail", 
                      "width": "100"
                  }, 
                  {
                      "content": {
                          "data": "http://localhost:8080/nuxeo/nxbigfile/default/8b2327e8-4497-4a65-914e-f384f6479c36/picture:views%2F4%2Fcontent/OriginalJpeg_landscape10.jpg", 
                          "digest": "69ead5818ce22854684f466adfe667ac", 
                          "encoding": null, 
                          "length": "313324", 
                          "mime-type": "image/jpeg", 
                          "name": "OriginalJpeg_landscape10.jpg"
                      }, 
                      "description": "Original Picture in JPEG format", 
                      "filename": "OriginalJpeg_landscape10.jpg", 
                      "height": "708", 
                      "tag": "originalJpeg", 
                      "title": "OriginalJpeg", 
                      "width": "1024"
                  }
              ]
          }, 
          "repository": "default", 
          "state": "project", 
          "title": "landscape10.jpg", 
          "type": "Picture", 
          "uid": "8b2327e8-4497-4a65-914e-f384f6479c36", 
          "versionLabel": "0.0"
      }
      

      They should be like

      http://localhost:8080/nuxeo/nxbigfile/default/8b2327e8-4497-4a65-914e-f384f6479c36/picture:views/item[0]/content/Medium_landscape10.jpg
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: