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

REST API: Provide way to load constraints defined on document

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.1
    • Fix Version/s: 8.10
    • Component/s: Rest API
    • Upgrade notes:
      Hide

      New json writers have been enabled and old one removed. A new fetch.schema=fields property allows to return extended schema fields containing validation constraints.

      Show
      New json writers have been enabled and old one removed. A new fetch.schema=fields property allows to return extended schema fields containing validation constraints.
    • Sprint:
      nxGang Sprint 8.4.8
    • Story Points:
      5

      Description

      The "schemas" endpoint should be updated to integrate constraints on fields.
      It currently returns :

      {
        "name" : "mySchema",
        "@prefix" : "ms",
        "fields" : {
          "id" : "string",
          "email" : "string"
        }
      

      It should returns:

      {
        "name" : "mySchema",
        "@prefix" : "ms",
        "fields" : {
          "id" : {
              "type": "string",
              "constraints": {
                   "NotNullConstraint": {}
               }
          }
          "email" : {
              "type": "string",
              "constraints": {
                   "NotNullConstraint": {},
                   "PatternConstraint": {
                       "Pattern" : "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?*"
                    }
               }
          }
        }
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: