-
-
Notifications
You must be signed in to change notification settings - Fork 432
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
Can't import SendGrid OpenAPI JSON: error converting YAML to JSON: yaml: control characters are not allowed #594
Can't import SendGrid OpenAPI JSON: error converting YAML to JSON: yaml: control characters are not allowed #594
Comments
I've just done a bit of further testing after submitting this, and it looks like it's rejecting the entire |
Sorry for multiple comments quickly, but I just realised the receiver of the return at the end of this switch {
case value == 0x09:
case value == 0x0A:
case value == 0x0D:
case value >= 0x20 && value <= 0x7E:
case value == 0x85:
case value >= 0xA0 && value <= 0xD7FF:
case value >= 0xE000 && value <= 0xFFFD:
case value >= 0x10000 && value <= 0x10FFFF:
default:
return yaml_parser_set_reader_error(parser,
"control characters are not allowed",
parser.offset, int(value))
} |
Last one, if we add case value >= 0x90 && value <= 0x9F: the file imports correctly. |
Hi! I've seen this before and pinned go-yaml/yaml#737 as the issue to track. |
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
Ah, my bad, I should've noticed that it was in the upstream package, not kin-openapi directly! Thanks for the quick response and the workaround! |
That's alright :) I don't really know how to move this forward, so if you can help getting this upstream that would be much easier to maintain. I'm thinking a message on the PR or on this issue: go-yaml/yaml#737 (comment) In the meantime I'll finish the kin-openapi PR. |
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
… reproducible Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
… reproducible Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
When we attempt to import the SendGrid OpenAPI spec at
https://raw.githubusercontent.com/sendgrid/sendgrid-oai/main/oai_v3_stoplight.json
usingopenapi3.NewLoader().LoadFromURI("https://raw.githubusercontent.com/sendgrid/sendgrid-oai/main/oai_v3_stoplight.json")
, we get the error in the title. This seems to be caused by the�
(U+009F
) character at position 14/15 within the string value of thecity
property of the following JSON object:This is perfectly valid JSON in this form, however the
kin-openapi
parser errors infunc yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool
atyaml.v3@v3.0.1/readerc.go:387
and I don't think it should.If you need any further details, please let me know.
The text was updated successfully, but these errors were encountered: