You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
User story.
As a user I want to reference JSON Schema Draft-06, Draft-07 or 2019-09 in schema function in my rulesets.
Is your feature request related to a problem?
I want to have a possibility to use newest JSON Schema drafts for schema validation in my custom rulesets. My data models are defined using draft-07 currently and they are not being loaded.
Describe the solution you'd like
I would like to add external referenced JSON Schema files following the latest drafts
Additional context
Custom Rulesets
The text was updated successfully, but these errors were encountered:
@jerzyn hey, im not sure what you mean by "not being loaded"? Do you have some example files we can play with and some expected behavior vs actual behavior?
AFAIK Spectral doesn't care about the JSON Schema draft version at all, it only cares that some sort of JSON/YAML file is being loaded and it will follow any$ref it finds along the way (including some places maybe it should not).
If you are using JSON Schema in the context of OpenAPI then that's a different thing. OpenAPI v3.0 does not support drafts of JSON Schema newer than its own "extended subset" of draft 5 and there is nothing we can do to change that other than hope my PR (OAI/OpenAPI-Specification#1977) goes through. Chatting to the OpenAPI TSC about that in 2 hours.
i was chatting about this with @P0lip - maybe check with him. As for files - using this: https://supermodel.io/adidas/api/HAL (not as a reference to this file but this exact code together with $schema) was not loading. Deleting $schema or changing it to draft-04 was fixing the issue. The rule was:
description: All success responses MUST be of media type `application/hal+json`
severity: error
given: $.paths..responses[?( @property >= 200 && @property < 300 )]
recommended: true
severity: error
type: "style"
message: "Response documents MUST follow application/hal+json: {{error}}"
then:
field: schema
function: schema
functionOptions:
schema:
$ref: ./hal.yaml```
User story.
As a user I want to reference JSON Schema Draft-06, Draft-07 or 2019-09 in schema function in my rulesets.
Is your feature request related to a problem?
I want to have a possibility to use newest JSON Schema drafts for schema validation in my custom rulesets. My data models are defined using draft-07 currently and they are not being loaded.
Describe the solution you'd like
I would like to add external referenced JSON Schema files following the latest drafts
Additional context
Custom Rulesets
The text was updated successfully, but these errors were encountered: