karenetheridge / JSON-Schema-Modern

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

on loading a document, warn if it looks like an OpenAPI document #61

Closed karenetheridge closed 2 years ago

karenetheridge commented 2 years ago

A user might mistakenly do $js->add_schema($uri => $schema_data) with an OpenAPI document, which will cause the data to be treated as a json schema rather than an openapi document with embedded schemas. We can detect the top-level keywords that indicate an openapi document and warn about them, pointing them to the correct code path (i.e. ->add_schema(JSON::Schema::Modern::Document::OpenAPI->new(...))).

karenetheridge commented 2 years ago

This was done in version 0.532.