-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Resolve evaluates node 'y' to true. Is this always required ? #740
Comments
In YAML 1.1, scalars like OpenAPI however documents this:
If go-yaml wants to implement the YAML 1.2 schemas, here is official test data: Note that the YAML JSON schema definition is a bit ambiguous in the YAML spec. Strictly speaking, all strings not being booleans or numbers would have to be quoted. The OpenAPI documentation is quite unclear regarding that. |
Thank you very much for the clarification @perlpunk. Quoting around the strings solved the issue for me. |
I see in the compatibility section that go-yaml supports YAML 1.2 and 1.1 |
We support a useful mix of the two: v2 handles them as booleans, while v3 tries to move us forward by only considering them as bool if you explicitly attempt to unmarshal the value onto a boolean. |
There is map created to resolve values which resolves y as below to true:
{true, yaml_BOOL_TAG, []string{"y", "Y", "yes", "Yes", "YES"}},
If the value of node is 'y' should it be resolved to 'true' always ?
I faced issue while generating go code from openAPI yaml --> oapi-codegen/oapi-codegen#362
Not sure if it is bug or I should never use the tags from the
resolveMapList
?yaml/resolve.go
Line 37 in 7649d45
The text was updated successfully, but these errors were encountered: