Open danmoser opened 4 days ago
This sounds to me like an understanding issue, rather than a tool issue. That file doesn't contain a schema at the root, which means that it's effectively equivalent to the schema {}
, and passes on any document.
The fastest, easiest path to get the validation you're looking for is to pull the relevant schema from $.components.schemas.my_data
into a distinct file and use that for validation.
I'd be happy to talk about tool enhancements to make this sort of workflow easier, but I want to be careful that any discussion starts from a common understanding of which part of the given document is a schema.[^1] I'll also note, as a warning about a potential issue, that openapi spec extends JSON Schema in several ways, not all of which are easy to support.
[^1]: relatedly, thanks for including a sample document in this issue! It makes it much easier to discuss.
I'm trying to validate a schema generated my OpenAPI and
check-jsonschema
is not working with it. In particular, I need to checkrequired
plusminimum
/maximum
fields.This is the schemafile:
This is the instance an example of instance file:
{"latitude":190.0}
.Currently
check-jsonschema
is returningok -- validation done