From ce1b4b629758361bec4b1103fa23a1c6437197c1 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 21 Jun 2019 13:05:34 +0200 Subject: [PATCH] Strip out all the words that match JSON Schema --- schemas/v3.1/meta-openapi.json | 173 +++++++-------------------- schemas/v3.1/openapi-vocabulary.json | 5 +- 2 files changed, 45 insertions(+), 133 deletions(-) diff --git a/schemas/v3.1/meta-openapi.json b/schemas/v3.1/meta-openapi.json index 667183f238..c195fec6c2 100644 --- a/schemas/v3.1/meta-openapi.json +++ b/schemas/v3.1/meta-openapi.json @@ -7,148 +7,63 @@ "$recursiveAnchor": true, "title": "OpenAPI Vocabulary Schema", "type": ["object", "boolean"], - "properties": { - "type": { - "type": "string", - "enum": [ - "array", - "boolean", - "integer", - "number", - "object", - "string" - ] + "allOf": [ + { + "$ref": "http://json-schema.org/draft/2019-WIP/schema" }, - "not": { - "oneOf": [ - { - "$ref": "#/$defs/Schema" # can i use recursiveAnchor for this or how do i ref myself + { + "properties": { + "type": { + "oneOf" : [ + { + "$ref": "#/$defs/AllowedTypes" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/AllowedTypes" + } + } + ] }, - { - "$ref": "#/$defs/Reference" // this is in the openapi-vocabulary.json any way to ref back up to it - } - ] - }, - "allOf": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/$defs/Schema" - }, - { - "$ref": "#/$defs/Reference" - } - ] - } - }, - "oneOf": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/$defs/Schema" - }, - { - "$ref": "#/$defs/Reference" - } - ] - } - }, - "anyOf": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/$defs/Schema" - }, - { - "$ref": "#/$defs/Reference" - } - ] - } - }, - "items": { - "oneOf": [ - { - "$ref": "#/$defs/Schema" + "nullable": { + "type": "boolean", + "default": false, + "deprecated": true }, - { - "$ref": "#/$defs/Reference" - } - ] - }, - "properties": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/$defs/Schema" - }, - { - "$ref": "#/$defs/Reference" - } - ] - } - }, - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/$defs/Schema" // TODO + "discriminator": { + "$ref": "#/$defs/Discriminator" }, - { - "$ref": "#/$defs/Reference" // TODO + "example": { + "deprecated": true }, - { - "type": "boolean" + "externalDocs": { + "$ref": "#/$defs/ExternalDocumentation" // how to reference this from openapi-vocabulary.json + }, + "xml": { + "$ref": "#/$defs/XML" } - ], - "default": true - }, - "description": { - "type": "string" - }, - "format": { - "type": "string" - }, - "default": { - }, - "nullable": { - "type": "boolean", - "default": false, - "deprecated": true - }, - "discriminator": { - "$ref": "#/$defs/Discriminator" - }, - "readOnly": { - "type": "boolean", - "default": false - }, - "writeOnly": { - "type": "boolean", - "default": false - }, - "example": { - }, - "externalDocs": { - "$ref": "#/$defs/ExternalDocumentation" // TODO - }, - "deprecated": { - "type": "boolean", - "default": false - }, - "xml": { - "$ref": "#/$defs/XML" + } } - }, + ], "patternProperties": { "^x-": { } }, "additionalProperties": false, - "$defs": { + "AllowedTypes": { + "type": "string", + "enum": [ + "array", + "boolean", + "integer", + "number", + "object", + "string", + "null" + ] + } "Discriminator": { "type": "object", "required": [ diff --git a/schemas/v3.1/openapi-vocabulary.json b/schemas/v3.1/openapi-vocabulary.json index a3677160ab..985219ab92 100644 --- a/schemas/v3.1/openapi-vocabulary.json +++ b/schemas/v3.1/openapi-vocabulary.json @@ -344,10 +344,7 @@ "additionalProperties": false }, "Schema": { - "allOf": [ - {"$ref": "http://json-schema.org/draft/2019-WIP/schema"}, - {"$ref": "https://spec.openapis.org/oas/3.1/meta"} - ] + "$ref": "https://spec.openapis.org/oas/3.1/meta" }, "Response": { "type": "object",