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

understand openapi format(s) when parsing documents #41

Closed karenetheridge closed 2 years ago

karenetheridge commented 3 years ago

Today, constructing a ::Document object with a non-schema entity will "work" (there are examples in the test suite of this, e.g. https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/2.0.0/remotes/subSchemas.json), but since the structure at the top level is not a schema, traversal will not proceed and $id and $anchor properties within will not be detected and indexed as resources to be used for URI resolution.

Implement some sort of mechanism (either autodection, or perhaps with a ::Document constructor option) to recognize the various openapi format(s) that come after draft2019-09 so we can properly traverse these documents. Likely this will involve defining a Vocabulary class that is capable of recognizing how subschemas are embedded in the document.

karenetheridge commented 3 years ago

public interfaces that will help integration with openapi-using web applications:

karenetheridge commented 3 years ago

subclassing ::Document would work.

karenetheridge commented 2 years ago

This is now in the bailiwick of JSON::Schema::Modern::Document::OpenAPI.