Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter description of null raises a validation error in Swagger-UI #395

Closed
wleeper opened this issue Apr 22, 2016 · 1 comment
Closed

Comments

@wleeper
Copy link
Contributor

wleeper commented Apr 22, 2016

If you don't provide a desc: field for a parameter, the generated swagger spec has null as the value for description. This raises a validation error in Swagger-UI

ex:

{
"in": "query",
"name": "force_refresh",
"description": null,
"type": "string",
"required": false
},

Produces the following validation error

schemaValidationMessages": [
{
"level": "error",
"domain": "validation",
"keyword": "oneOf",
"message": "instance failed to match exactly one schema (matched 0 out of 2)",
"schema": {
"loadingURI": "http://swagger.io/v2/schema.json#",
"pointer": "/definitions/parametersList/items"
},
"instance": {
"pointer": "/paths/test/get/parameters/3"
}
},

Recommendation
Based on http://swagger.io/specification/#parameterObject the description is optional and should be omitted when nil

@LeFnord
Copy link
Member

LeFnord commented Apr 24, 2016

@wleeper have a look on #399 and give it a try

@LeFnord LeFnord closed this as completed Apr 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants