From d614c23c17fc6d437c8c15de3edb32f2344c5b43 Mon Sep 17 00:00:00 2001 From: Joel Wurtz Date: Mon, 11 Jan 2016 01:19:28 +0100 Subject: [PATCH 1/2] Replace $ref field by reference to jsonReference object --- schemas/v2.0/schema.json | 71 ++++++++++++++++++++++++++++++++-------- 1 file changed, 58 insertions(+), 13 deletions(-) diff --git a/schemas/v2.0/schema.json b/schemas/v2.0/schema.json index e63aef6334..84a13b9425 100644 --- a/schemas/v2.0/schema.json +++ b/schemas/v2.0/schema.json @@ -171,7 +171,14 @@ "$ref": "#/definitions/vendorExtension" }, "^/": { - "$ref": "#/definitions/pathItem" + "oneOf": [ + { + "$ref": "#/definitions/pathItem" + }, + { + "$ref": "#/definitions/jsonReference" + } + ] } }, "additionalProperties": false @@ -179,7 +186,14 @@ "definitions": { "type": "object", "additionalProperties": { - "$ref": "#/definitions/schema" + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/jsonReference" + } + ] }, "description": "One or more JSON objects describing the schemas being consumed and produced by the API." }, @@ -296,9 +310,6 @@ } }, "properties": { - "$ref": { - "type": "string" - }, "get": { "$ref": "#/definitions/operation" }, @@ -374,6 +385,9 @@ }, { "$ref": "#/definitions/fileSchema" + }, + { + "$ref": "#/definitions/jsonReference" } ] }, @@ -511,7 +525,14 @@ "default": false }, "schema": { - "$ref": "#/definitions/schema" + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/jsonReference" + } + ] } }, "additionalProperties": false @@ -925,9 +946,6 @@ } }, "properties": { - "$ref": { - "type": "string" - }, "format": { "type": "string" }, @@ -990,6 +1008,9 @@ { "$ref": "#/definitions/schema" }, + { + "$ref": "#/definitions/jsonReference" + }, { "type": "boolean" } @@ -1004,11 +1025,21 @@ { "$ref": "#/definitions/schema" }, + { + "$ref": "#/definitions/jsonReference" + }, { "type": "array", "minItems": 1, "items": { - "$ref": "#/definitions/schema" + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/jsonReference" + } + ] } } ], @@ -1018,13 +1049,27 @@ "type": "array", "minItems": 1, "items": { - "$ref": "#/definitions/schema" + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/jsonReference" + } + ] } }, "properties": { "type": "object", "additionalProperties": { - "$ref": "#/definitions/schema" + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/jsonReference" + } + ] }, "default": {} }, @@ -1588,4 +1633,4 @@ } } } -} \ No newline at end of file +} From 4ab8cb77f418bbe784404ebb303d6b1e43dcd811 Mon Sep 17 00:00:00 2001 From: Joel Wurtz Date: Thu, 14 Jan 2016 00:50:57 +0100 Subject: [PATCH 2/2] Remove no additionalProperties in json reference (allow anything by default) --- schemas/v2.0/schema.json | 1 - 1 file changed, 1 deletion(-) diff --git a/schemas/v2.0/schema.json b/schemas/v2.0/schema.json index 84a13b9425..9080fd2231 100644 --- a/schemas/v2.0/schema.json +++ b/schemas/v2.0/schema.json @@ -1625,7 +1625,6 @@ "required": [ "$ref" ], - "additionalProperties": false, "properties": { "$ref": { "type": "string"