pb33f / libopenapi

libopenapi is a fully featured, high performance OpenAPI 3.1, 3.0 and Swagger parser, library, validator and toolkit for golang applications.
https://pb33f.io/libopenapi/
Other
482 stars 64 forks source link

invalid OpenAPI specification should retains the Json schema validator errors #349

Open LasneF opened 2 weeks ago

LasneF commented 2 weeks ago

given the doctor

when i set a valid Json but invalid API spect i got unable to parse OpenAPI specification: The requested specification cannot be parsed as an OpenAPI Spec. vaccum cannot read the file: unable to parse specification: yaml: control characters are not allowed

in fact it could be interesting to distinguiish the 2 use case invalid JSON / YAML file ( sue as mention to wrong char, or not closed brackets and so on

vs an issue due to the fact that the OAS does not comply with the OAS schema

in both case it would be interesting to retains the error of the underlying ( parser , or json schema validator) to be able to correct

in my case i was using such license: name: Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International identifier: CC-BY-NC-SA-4.0 url: https://toto.toata

would be interesting to have the schema validator exception that would have mentionned that the 2 fields are exclusive

notice here is basic , could be more complex / real , topic being to have the infra to store what parser / validator generate