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
I'm building a service that has an API catalog. To make the CRUD on API entities, I'm using schema validation with latest version of AJV, which support last JSON schema draft (v6).
I didn't found an official JSON schema for openapi 3.0 spec (I suscribed to this issue to get notified when one is available: OAI/OpenAPI-Specification#1032), so I'm using the one in this repository which seems to be the last up to date.
However, my validator complain and this schema does not seem to be draft v6 compatible. Is it possible to :
replace "format": "uriref" with "format": "uri-reference"
add a $id property at the root of the schema
replace "exclusiveMinimum": true with "exclusiveMinimum": 0 and remove "minimum": 0
I can also make a PR if you want, but I have no idea of the $id to use.
And 👍 for the great work you're doing on the openapi 3 spec !
The text was updated successfully, but these errors were encountered:
Hmm, this is complicated. OpenAPI 3.0.0 specifies the use of JSON Schema Draft 5, so it makes sense that the schemas which validate it should also be Draft 5, not Draft 6 or (the latest) Draft 7.
It is possible to manipulate ajv into working in Draft 5 mode, here's how it's done in validate.js:
varajv=require('ajv')({allErrors: true,verbose: true,jsonPointers: true,patternGroups: true,extendRefs: true// optional, current default is to 'fail', spec behaviour is to 'ignore'});//meta: false, // optional, to prevent adding draft-06 meta-schemavarajvFormats=require('ajv/lib/compile/formats.js');ajv.addFormat('uriref',ajvFormats.full['uri-reference']);ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json'));ajv._refs['http://json-schema.org/schema']='http://json-schema.org/draft-04/schema';// optional, using unversioned URI is out of specvarmetaSchema=require('ajv/lib/refs/json-schema-v5.json');ajv.addMetaSchema(metaSchema);ajv._opts.defaultMeta=metaSchema.id;
Hi,
I'm building a service that has an API catalog. To make the CRUD on API entities, I'm using schema validation with latest version of AJV, which support last JSON schema draft (v6).
I didn't found an official JSON schema for openapi 3.0 spec (I suscribed to this issue to get notified when one is available: OAI/OpenAPI-Specification#1032), so I'm using the one in this repository which seems to be the last up to date.
However, my validator complain and this schema does not seem to be draft v6 compatible. Is it possible to :
"format": "uriref"
with"format": "uri-reference"
$id
property at the root of the schema"exclusiveMinimum": true
with"exclusiveMinimum": 0
and remove"minimum": 0
I can also make a PR if you want, but I have no idea of the
$id
to use.And 👍 for the great work you're doing on the openapi 3 spec !
The text was updated successfully, but these errors were encountered: