We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using a path parameter named y causes spec validation to fail.
y
swagger: '2.0' info: version: 1.0.0 title: Go Swagger Test paths: /letters/{y}: parameters: - name: y type: integer format: uint64 description: Column id. in: path required: true get: summary: Get letter. description: Get a letter. produces: - text/plain responses: 200: description: A letter. schema: type: string
Save the above spec as spec/test.yml and run the following:
spec/test.yml
docker run --rm --volume "$(pwd)":/data quay.io/goswagger/swagger:0.16.0 validate /data/spec/test.yml
The result is json: cannot unmarshal bool into Go struct field SwaggerProps.paths of type string. This is unexpected.
json: cannot unmarshal bool into Go struct field SwaggerProps.paths of type string
If you change the parameter name from y to z (or lots of other letters, I didn't try them all), validation succeeds (as expected).
z
swagger version: 0.16.0 go version: 1.11 OS: macOS 10.13
The text was updated successfully, but these errors were encountered:
I just noticed that if I quote the letter y, things work again. Curious why this is required with y and not other letters.
Sorry, something went wrong.
this is due to yaml: 'y' unmarshals as boolean true
Full list here, case does not matter: #1209 (comment)
http://yaml.org/type/bool.html
Thanks for the responses. I'll file away this bit of new yaml knowledge.
No branches or pull requests
Problem statement
Using a path parameter named
y
causes spec validation to fail.Swagger specification
Steps to reproduce
Save the above spec as
spec/test.yml
and run the following:The result is
json: cannot unmarshal bool into Go struct field SwaggerProps.paths of type string
. This is unexpected.If you change the parameter name from
y
toz
(or lots of other letters, I didn't try them all), validation succeeds (as expected).Environment
swagger version: 0.16.0
go version: 1.11
OS: macOS 10.13
The text was updated successfully, but these errors were encountered: