|
1 | 1 | {
|
2 |
| - "description": "An object representing either a schema or a multiFormatSchema based on the existence of the 'schema' property. If the property 'schema' is present, use the multi-format schema. Use the default AsyncAPI Schema otherwise.", |
| 2 | + "$id": "http://asyncapi.com/definitions/3.0.0/anySchema.json", |
| 3 | + "$schema": "http://json-schema.org/draft-07/schema#", |
3 | 4 | "type": "object",
|
4 |
| - "anyOf": [ |
5 |
| - { |
6 |
| - "type": "object", |
7 |
| - "description": "AsyncAPI Schema", |
8 |
| - "not": { |
9 |
| - "required": ["schemaFormat", "schema"] |
10 |
| - }, |
11 |
| - "additionalProperties": false, |
12 |
| - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" |
13 |
| - }, |
14 |
| - { |
15 |
| - "type": "object", |
16 |
| - "description": "Multi format schema: Avro Schema", |
17 |
| - "required": ["schemaFormat", "schema"], |
18 |
| - "not": {"required": ["$ref"]}, |
19 |
| - "additionalProperties": false, |
20 |
| - "properties": { |
21 |
| - "schemaFormat": { |
22 |
| - "type": "string", |
23 |
| - "enum": [ |
24 |
| - "application/vnd.apache.avro;version=1.9.0", |
25 |
| - "application/vnd.apache.avro+json;version=1.9.0", |
26 |
| - "application/vnd.apache.avro+yaml;version=1.9.0" |
27 |
| - ] |
28 |
| - }, |
29 |
| - "schema": { |
30 |
| - "if": { |
31 |
| - "not": {"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"} |
32 |
| - }, |
33 |
| - "then": { |
34 |
| - "$ref": "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json" |
35 |
| - }, |
36 |
| - "else": { |
37 |
| - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" |
38 |
| - } |
39 |
| - } |
40 |
| - } |
| 5 | + "description": "An object representing either a Reference, a Schema or a Multi Format Schema", |
| 6 | + "properties": { |
| 7 | + "schemaFormat": { |
| 8 | + "type": "string", |
| 9 | + "description": "Supported Schema format" |
41 | 10 | },
|
42 |
| - { |
| 11 | + "schema": { |
43 | 12 | "type": "object",
|
44 |
| - "description": "Multi format schema: OpenAPI Schema", |
45 |
| - "required": ["schemaFormat", "schema"], |
46 |
| - "not": {"required": ["$ref"]}, |
47 |
| - "additionalProperties": false, |
48 |
| - "properties": { |
49 |
| - "schemaFormat": { |
50 |
| - "type": "string", |
51 |
| - "enum": [ |
52 |
| - "application/vnd.oai.openapi;version=3.0.0", |
53 |
| - "application/vnd.oai.openapi+json;version=3.0.0", |
54 |
| - "application/vnd.oai.openapi+yaml;version=3.0.0" |
55 |
| - ] |
56 |
| - }, |
57 |
| - "schema": { |
58 |
| - "anyOf": [ |
59 |
| - { |
60 |
| - "$ref": "http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json" |
61 |
| - }, |
62 |
| - { |
63 |
| - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" |
64 |
| - } |
65 |
| - ] |
66 |
| - } |
67 |
| - } |
| 13 | + "description": "Schema definition" |
68 | 14 | },
|
| 15 | + "$ref": { |
| 16 | + "type": "string", |
| 17 | + "description": "Reference to schema" |
| 18 | + } |
| 19 | + }, |
| 20 | + "minProperties": 1, |
| 21 | + "oneOf": [ |
69 | 22 | {
|
70 |
| - "type": "object", |
71 |
| - "description": "Multi format schema: Json Schema", |
72 |
| - "required": ["schemaFormat", "schema"], |
73 |
| - "not": {"required": ["$ref"]}, |
74 |
| - "additionalProperties": false, |
75 |
| - "properties": { |
76 |
| - "schemaFormat": { |
77 |
| - "type": "string", |
78 |
| - "enum": [ |
79 |
| - "application/schema+json;version=draft-07", |
80 |
| - "application/schema+yaml;version=draft-07" |
81 |
| - ] |
| 23 | + "description": "Because of $ref collision in Reference and AsyncAPI Schema(includes $ref from Json Schema)", |
| 24 | + "not": {"required": ["schemaFormat", "schema"]}, |
| 25 | + "anyOf": [ |
| 26 | + { |
| 27 | + "type": "object", |
| 28 | + "required": ["$ref"], |
| 29 | + "not": {"required": ["schemaFormat", "schema"]}, |
| 30 | + "minProperties": 1, |
| 31 | + "maxProperties": 1, |
| 32 | + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" |
82 | 33 | },
|
83 |
| - "schema": { |
84 |
| - "$ref": "http://json-schema.org/draft-07/schema" |
| 34 | + { |
| 35 | + "type": "object", |
| 36 | + "not": {"required": ["schemaFormat", "schema"]}, |
| 37 | + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" |
85 | 38 | }
|
86 |
| - } |
| 39 | + ] |
87 | 40 | },
|
88 | 41 | {
|
89 | 42 | "type": "object",
|
90 |
| - "description": "Multi format schema: AsyncAPI Schema", |
91 | 43 | "required": ["schemaFormat", "schema"],
|
92 | 44 | "not": {"required": ["$ref"]},
|
93 |
| - "additionalProperties": false, |
94 |
| - "properties": { |
95 |
| - "schemaFormat": { |
96 |
| - "type": "string", |
97 |
| - "enum": [ |
98 |
| - "application/vnd.aai.asyncapi;version=2.0.0", |
99 |
| - "application/vnd.aai.asyncapi+json;version=2.0.0", |
100 |
| - "application/vnd.aai.asyncapi+yaml;version=2.0.0", |
101 |
| - "application/vnd.aai.asyncapi;version=2.1.0", |
102 |
| - "application/vnd.aai.asyncapi+json;version=2.1.0", |
103 |
| - "application/vnd.aai.asyncapi+yaml;version=2.1.0", |
104 |
| - "application/vnd.aai.asyncapi;version=2.2.0", |
105 |
| - "application/vnd.aai.asyncapi+json;version=2.2.0", |
106 |
| - "application/vnd.aai.asyncapi+yaml;version=2.2.0", |
107 |
| - "application/vnd.aai.asyncapi;version=2.3.0", |
108 |
| - "application/vnd.aai.asyncapi+json;version=2.3.0", |
109 |
| - "application/vnd.aai.asyncapi+yaml;version=2.3.0", |
110 |
| - "application/vnd.aai.asyncapi;version=2.4.0", |
111 |
| - "application/vnd.aai.asyncapi+json;version=2.4.0", |
112 |
| - "application/vnd.aai.asyncapi+yaml;version=2.4.0", |
113 |
| - "application/vnd.aai.asyncapi;version=2.5.0", |
114 |
| - "application/vnd.aai.asyncapi+json;version=2.5.0", |
115 |
| - "application/vnd.aai.asyncapi+yaml;version=2.5.0", |
116 |
| - "application/vnd.aai.asyncapi;version=2.6.0", |
117 |
| - "application/vnd.aai.asyncapi+json;version=2.6.0", |
118 |
| - "application/vnd.aai.asyncapi+yaml;version=2.6.0", |
119 |
| - "application/vnd.aai.asyncapi;version=3.0.0", |
120 |
| - "application/vnd.aai.asyncapi+json;version=3.0.0", |
121 |
| - "application/vnd.aai.asyncapi+yaml;version=3.0.0" |
122 |
| - ] |
123 |
| - }, |
124 |
| - "schema": { |
125 |
| - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" |
126 |
| - } |
127 |
| - } |
| 45 | + "minProperties": 2, |
| 46 | + "maxProperties": 2, |
| 47 | + "$ref": "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json" |
128 | 48 | }
|
129 |
| - ], |
130 |
| - "$schema": "http://json-schema.org/draft-07/schema#", |
131 |
| - "$id": "http://asyncapi.com/definitions/3.0.0/anySchema.json" |
| 49 | + ] |
132 | 50 | }
|
0 commit comments