-
Notifications
You must be signed in to change notification settings - Fork 78
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
Escape colon #371
Comments
@MikeRalphson this might a thing for oas-resolver? |
This is unrelated to |
I'm having a similar issue with a date. I have the following example: '2019-10-10' That speccy transforms to example: 2019-10-10 But I want the example to be treated as a string, is there any way I can force speccy to respect this quote? It should respect it by default right? |
2019-10-10 cannot be interpreted as a boolean, number or null, therefore it is a string by default and does not require any quoting. Probably a bug in SwaggerHub. |
It can be interpreted as a date, which is what's happening. That's why the quotes should be preserved in this case. It's not a string by default. js-yaml issue where it's mentioned that swagger-ui issue where a similar case is mentioned with the solution being to add the quotes swagger-api/swagger-ui#5061 (comment) |
Another option from the YAML spec is to use tags like |
From the OpenAPI spec:
The JSON Schema ruleset does not include the |
Oh it's because of the JSON Schema then. It's not a bug then as you said. Thanks! For anyone that ends up here I used this workaround to preserve the quotes: example: |
2019-10-10 |
I think this issue can be closed then, right? |
I said it was probably a bug in SwaggerHub. If they're not limiting their yaml parsing to the JSON Schema ruleset, then that's a bug. |
All issues here should be closed. Speccy is unmaintained. |
I mean that it's not a problem with |
Ah, apologies for misreading. |
no problem, I should have been more clear :) |
Detailed description
When I create an example with a value that contains a colon like this:
speccy resolve
command converts the range value string in a value without quote:and in SwaggerHub editor I see this:
Possible implementation
When quotes are used to define the value of a variable,
speccy resolve
command can consider the quotes and apply them to the generated fileYour environment
Include as many relevant details about the environment you experienced the bug in and how to reproduce it.
The text was updated successfully, but these errors were encountered: