APIDevTools / swagger-cli

Swagger 2.0 and OpenAPI 3.0 command-line tool
https://apitools.dev/swagger-cli
MIT License
515 stars 69 forks source link

Single quotes added to property name when using bundle command #64

Closed glindsell closed 3 years ago

glindsell commented 3 years ago

Using:

❯ swagger-cli --version
4.0.4

When I perform the following command:

swagger-cli bundle docs/api/v2/openapi.yaml --outfile docs/api/v2/_build/openapi.yaml --type yaml

to bundle a large API which has been split into smaller files, in one of the schemas of the bundled output file only the property y has single quotes added. I can't see a reason as to why the quotes are added, and why it is only happening to the y property.

Input file before bundle:

Screenshot 2021-06-07 at 09 22 48

Output file after bundle: image

glindsell commented 3 years ago

This is occurring because y is a keyword in yaml:

https://makandracards.com/makandra/24809-yaml-keys-like-yes-or-no-evaluate-to-true-and-false

Closing.