Uploaded image for project: 'Syncope'
  1. Syncope
  2. SYNCOPE-1274

Report required and read-only payload properties in OpenApi spec

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.7
    • 2.0.8, 2.1.0
    • common

    Description

      The OpenApi spec is currently missing any required and read-only information about payload properties.

      For example, the POST /users endpoint reports the following sample value:

      {
        "creator": "string",
        "creationDate": "2018-02-11T14:19:38.905Z",
        "lastModifier": "string",
        "lastChangeDate": "2018-02-11T14:19:38.905Z",
        "key": "string",
        "type": "string",
        "realm": "string",
        "status": "string",
        "password": "string",
        "token": "string",
        "tokenExpireTime": "2018-02-11T14:19:38.905Z",
        "username": "string",
        "lastLoginDate": "2018-02-11T14:19:38.905Z",
        "changePwdDate": "2018-02-11T14:19:38.905Z",
        "failedLogins": 0,
        "securityQuestion": "string",
        "securityAnswer": "string",
        "suspended": true,
        "mustChangePassword": true
      }
      

      which should be better instead

      {
        "realm": "string",
        "@class": "org.apache.syncope.common.lib.to.UserTO",
        "password": "string",
        "username": "string",
        "securityQuestion": "string",
        "securityAnswer": "string"
      }
      

      (also note the Jackson's @class management).

      Similar for models (see attachments as samples).

      Attachments

        1. model-before.png
          26 kB
          Francesco Chicchiriccò
        2. model-after.png
          72 kB
          Francesco Chicchiriccò

        Activity

          People

            ilgrosso Francesco Chicchiriccò
            ilgrosso Francesco Chicchiriccò
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: