-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: AsyncAPI v3 shows warning in Studio and IntelliJ plugin when ref…
…erencing a json schema New multiFormatSchema validation rules #494 asyncapi/jasyncapi-idea-plugin#49
- Loading branch information
Showing
12 changed files
with
1,881 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,132 +1,50 @@ | ||
{ | ||
"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.", | ||
"$id": "http://asyncapi.com/definitions/3.0.0/anySchema.json", | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"type": "object", | ||
"anyOf": [ | ||
{ | ||
"type": "object", | ||
"description": "AsyncAPI Schema", | ||
"not": { | ||
"required": ["schemaFormat", "schema"] | ||
}, | ||
"additionalProperties": false, | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" | ||
}, | ||
{ | ||
"type": "object", | ||
"description": "Multi format schema: Avro Schema", | ||
"required": ["schemaFormat", "schema"], | ||
"not": {"required": ["$ref"]}, | ||
"additionalProperties": false, | ||
"properties": { | ||
"schemaFormat": { | ||
"type": "string", | ||
"enum": [ | ||
"application/vnd.apache.avro;version=1.9.0", | ||
"application/vnd.apache.avro+json;version=1.9.0", | ||
"application/vnd.apache.avro+yaml;version=1.9.0" | ||
] | ||
}, | ||
"schema": { | ||
"if": { | ||
"not": {"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"} | ||
}, | ||
"then": { | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json" | ||
}, | ||
"else": { | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" | ||
} | ||
} | ||
} | ||
"description": "An object representing either a Reference, a Schema or a Multi Format Schema", | ||
"properties": { | ||
"schemaFormat": { | ||
"type": "string", | ||
"description": "Supported Schema format" | ||
}, | ||
{ | ||
"schema": { | ||
"type": "object", | ||
"description": "Multi format schema: OpenAPI Schema", | ||
"required": ["schemaFormat", "schema"], | ||
"not": {"required": ["$ref"]}, | ||
"additionalProperties": false, | ||
"properties": { | ||
"schemaFormat": { | ||
"type": "string", | ||
"enum": [ | ||
"application/vnd.oai.openapi;version=3.0.0", | ||
"application/vnd.oai.openapi+json;version=3.0.0", | ||
"application/vnd.oai.openapi+yaml;version=3.0.0" | ||
] | ||
}, | ||
"schema": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json" | ||
}, | ||
{ | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" | ||
} | ||
] | ||
} | ||
} | ||
"description": "Schema definition" | ||
}, | ||
"$ref": { | ||
"type": "string", | ||
"description": "Reference to schema" | ||
} | ||
}, | ||
"minProperties": 1, | ||
"oneOf": [ | ||
{ | ||
"type": "object", | ||
"description": "Multi format schema: Json Schema", | ||
"required": ["schemaFormat", "schema"], | ||
"not": {"required": ["$ref"]}, | ||
"additionalProperties": false, | ||
"properties": { | ||
"schemaFormat": { | ||
"type": "string", | ||
"enum": [ | ||
"application/schema+json;version=draft-07", | ||
"application/schema+yaml;version=draft-07" | ||
] | ||
"description": "Because of $ref collision in Reference and AsyncAPI Schema(includes $ref from Json Schema)", | ||
"not": {"required": ["schemaFormat", "schema"]}, | ||
"anyOf": [ | ||
{ | ||
"type": "object", | ||
"required": ["$ref"], | ||
"not": {"required": ["schemaFormat", "schema"]}, | ||
"minProperties": 1, | ||
"maxProperties": 1, | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" | ||
}, | ||
"schema": { | ||
"$ref": "http://json-schema.org/draft-07/schema" | ||
{ | ||
"type": "object", | ||
"not": {"required": ["schemaFormat", "schema"]}, | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "object", | ||
"description": "Multi format schema: AsyncAPI Schema", | ||
"required": ["schemaFormat", "schema"], | ||
"not": {"required": ["$ref"]}, | ||
"additionalProperties": false, | ||
"properties": { | ||
"schemaFormat": { | ||
"type": "string", | ||
"enum": [ | ||
"application/vnd.aai.asyncapi;version=2.0.0", | ||
"application/vnd.aai.asyncapi+json;version=2.0.0", | ||
"application/vnd.aai.asyncapi+yaml;version=2.0.0", | ||
"application/vnd.aai.asyncapi;version=2.1.0", | ||
"application/vnd.aai.asyncapi+json;version=2.1.0", | ||
"application/vnd.aai.asyncapi+yaml;version=2.1.0", | ||
"application/vnd.aai.asyncapi;version=2.2.0", | ||
"application/vnd.aai.asyncapi+json;version=2.2.0", | ||
"application/vnd.aai.asyncapi+yaml;version=2.2.0", | ||
"application/vnd.aai.asyncapi;version=2.3.0", | ||
"application/vnd.aai.asyncapi+json;version=2.3.0", | ||
"application/vnd.aai.asyncapi+yaml;version=2.3.0", | ||
"application/vnd.aai.asyncapi;version=2.4.0", | ||
"application/vnd.aai.asyncapi+json;version=2.4.0", | ||
"application/vnd.aai.asyncapi+yaml;version=2.4.0", | ||
"application/vnd.aai.asyncapi;version=2.5.0", | ||
"application/vnd.aai.asyncapi+json;version=2.5.0", | ||
"application/vnd.aai.asyncapi+yaml;version=2.5.0", | ||
"application/vnd.aai.asyncapi;version=2.6.0", | ||
"application/vnd.aai.asyncapi+json;version=2.6.0", | ||
"application/vnd.aai.asyncapi+yaml;version=2.6.0", | ||
"application/vnd.aai.asyncapi;version=3.0.0", | ||
"application/vnd.aai.asyncapi+json;version=3.0.0", | ||
"application/vnd.aai.asyncapi+yaml;version=3.0.0" | ||
] | ||
}, | ||
"schema": { | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" | ||
} | ||
} | ||
"minProperties": 2, | ||
"maxProperties": 2, | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json" | ||
} | ||
], | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://asyncapi.com/definitions/3.0.0/anySchema.json" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.