karenetheridge / JSON-Schema-Modern

Validate data against a schema using a JSON Schema
https://metacpan.org/release/JSON-Schema-Modern/
Other
11 stars 1 forks source link

schema linter #17

Open karenetheridge opened 4 years ago

karenetheridge commented 4 years ago

It has been brought up on slack that a "lint" feature would be useful - this would look for potential problems in as schema that, while they are legal syntax, are generally nonsensical constructs. This would include missing keywords, or keywords used in strange combinations with each other.

From @ssilverman:

my additions:

@notEthan's ideas (warnings, not errors):

karenetheridge commented 4 years ago

see also this thread. https://app.slack.com/client/T5CHC2TAN/CT8QRGTK5/thread/CT8QRGTK5-1589687250.289900

thread captured here before the scrollback vanishes: https://www.dropbox.com/s/w08yp1u8ziu8wqh/Screen%20Shot%202021-07-19%20at%2009.24.10.png?dl=0

karenetheridge commented 4 years ago

my additions part 2:

karenetheridge commented 4 years ago

(and if the type of an instance is restricted to things that aren't object or array, 'default' makes no sense at all, because a missing item will never get the annotation - it only makes sense for non-scalar types)

karenetheridge commented 3 years ago

xref https://github.com/json-schema-org/json-schema-spec/issues/1079

gregsdennis commented 1 year ago

also xref https://github.com/orgs/json-schema-org/discussions/323

karenetheridge commented 1 year ago
karenetheridge commented 1 year ago

and see the additions we can do for openapi linting: https://github.com/karenetheridge/OpenAPI-Modern/issues/59