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

enum : swagger editor automatically adds single quotes to enum string value "Y" #2006

Closed
KurtCoppens opened this issue Jun 17, 2019 · 3 comments

Comments

@KurtCoppens
Copy link

An example :
- name: periodUnit
in: query
description: The requested rate period unit
required: true
type: string
enum:
- Y
- M
- D
- W
Swagger editor converts Y to 'Y' after saving the file :
- name: periodUnit
in: query
description: The requested rate period unit
required: true
type: string
enum:
- 'Y'
- M
- D
- W

@hkosova
Copy link
Contributor

hkosova commented Jun 18, 2019

Some YAML parsers treat the strings y Y n N yes no on off (and some others) as boolean values. Adding quotes around Y enforces the string type and will help avoid parsing issues in other OpenAPI-related tools.

@KurtCoppens
Copy link
Author

Dear Helena,
Thank you for your clear answer.
Kurt

@shockey
Copy link
Contributor

shockey commented Jun 19, 2019

this sounds resolved -- closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants