SysML-v2-API-Services icon indicating copy to clipboard operation
SysML-v2-API-Services copied to clipboard

potential issues found in openapi.json - body should be required on POST and PUT methods, document states that these are not required

Open samatstariongroup opened this issue 2 years ago • 0 comments
trafficstars

Dear All,

I am studying the openapi.json file at https://raw.githubusercontent.com/Systems-Modeling/SysML-v2-API-Services/master/public/docs/openapi.json.

The postProject operation as specified between lines 80 and 100:

      "post": {
        "tags": [
          "Project"
        ],
        "summary": "Create project",
        "operationId": "postProject",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectRequest"
              },
              "examples": {
                "ProjectRequest": {
                  "$ref": "#/components/examples/ProjectRequest"
                }
              }
            }
          },
          "required": false
        }

states that a POST body is not required (see "required": false. Since one has to specify at least the name and an optional description that seems to be a bit odd. I think it should be "required": true.

The same can be found on the PUT method

samatstariongroup avatar Apr 29 '23 12:04 samatstariongroup