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

Add the entity-type inside the rest response content type header

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 7.10
    • Fix Version/s: 7.10-HF06, 8.2
    • Component/s: Rest API

      Description

      In order to specify which kind of resource in the JSON payload Nuxeo is returning, we need to include the entity-type inside the content type response header rather than in the JSON itself. (or into a special response header "Nuxeo-Entity-Type)

      We can keep it for compatibility (for automation client etc...) inside the body but we need to declare in the response header the entity-type like document or documents to have a more proper semantic http response and a proper unmarshalling on client side:

      For instance in Java, you have to unmarshall in a general way the body for then using the proper object to map on it. (after knowing which entity-type it is).

      And if the entity-type was the object itself (i.e. "DocumentModel.class") instead of the hardcoded one (i.e. "document") ? In this way we would be able to extend the "business object" feature side.

      Content-Type header now returns the nuxeo-entity type as well: application/json; nuxeo-entity=documents

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: