Swagger Editor shows the “Schema error: should NOT have additional properties” error for a path parameter

后端 未结 3 603
死守一世寂寞
死守一世寂寞 2021-01-01 09:32

I\'m using http://editor.swagger.io to design an API and I get an error which I don\'t know how to address:

Schema error at paths[\'/employees/{employeeId}/r         


        
相关标签:
3条回答
  • 2021-01-01 09:55

    The syntax requires might require two parameters, as mentioned by Helen required: true is need so is type:DataType . The error is misleading.

    0 讨论(0)
  • 2021-01-01 09:57

    The error message is misleading. The actual error is that your path parameter is missing required: true. Path parameters are always required, so remember to add required: true to them.

    0 讨论(0)
  • 2021-01-01 10:07

    Had the same problem. I accidentally mixed up the syntax from Swagger 2.0 with Openapi 3.0.x. In Openapi 3.0.x, definitions are redefined as components. In the online editor you can click on the button Edit > Convert to OpenAPI 3 to use Openapi 3.0.x.

    Read more about components here.

    Remark:

    OAS 3 is the latest version of the OpenAPI Specification.

    0 讨论(0)
提交回复
热议问题