How to define an optional parameter in path using swagger

后端 未结 5 1960
名媛妹妹
名媛妹妹 2020-12-29 00:51

There is a function in my REST web service working with GET method and it has two optional parameters.

I tried to define it in Swagger but I encountered an error, <

5条回答
  •  没有蜡笔的小新
    2020-12-29 01:39

    Your YAML fails because as it stated on the specification:

    Determines whether this parameter is mandatory. If the parameter is in "path", this property is required and its value MUST be true.

    Source: http://swagger.io/specification/#parameterObject (Look in fixed fields table)

提交回复
热议问题