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

Cannot validate with OpenAPI specification schema #336

Open
navrocky opened this issue Nov 12, 2024 · 4 comments
Open

Cannot validate with OpenAPI specification schema #336

navrocky opened this issue Nov 12, 2024 · 4 comments

Comments

@navrocky
Copy link

I've tried loading two different OpenAPI json schemas and failed both times.

  1. With OpenAPI schema 3.0.x (2019-04-02) i've get unexpected exception "type must be number, but is boolean" when executing set_root_schema
  2. With OpenAPI schema 3.1 (2020-12) set_root_schema completed without errors, but the subsequent validation was always successful and even in the case of incorrect json.

Here is a sample project with errors: github.com/navrocky/cpp-json-schema-validation-errors

@rpatters1
Copy link
Contributor

I am trying to use the MNX schema (2020-12) and it is blowing up on set_root_schema as well. But the README says it supports draft-07. Is the README out of date, or has this repo fallen behind the schema drafts? Is 2020-12 even supposed to work?

@gmabey
Copy link

gmabey commented Jan 21, 2025

Same for me with the SigMF schema https://github.com/sigmf/SigMF

@gmabey
Copy link

gmabey commented Jan 23, 2025

Everything is working great for me now with #338 -- and after I started passing nlohmann::json_schema::default_string_format_check as the 2nd arg to the constructor.
Can @navrocky and @rpatters1 confirm that #338 fixes their issues so that this issue can be closed?

@rpatters1
Copy link
Contributor

I created the PR because it fixed my problem. So, yes, my problem is fixed by it.

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