Skip to content

Commit

Permalink
update multi format messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni committed May 13, 2024
1 parent dc0d01d commit 90a2d26
Show file tree
Hide file tree
Showing 3 changed files with 413 additions and 530 deletions.
235 changes: 55 additions & 180 deletions definitions/3.0.0/multiFormatSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,197 +6,72 @@
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"if": {
"not": {
"type": "object"
}
},
"then": {
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json"
},
"else": {
"properties": {
"schemaFormat": {
"description": "A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.",
"anyOf": [
{
"type": "string"
},
{
"description": "All the schema formats tooling MUST support",
"enum": [
"application/schema+json;version=draft-07",
"application/schema+yaml;version=draft-07",
"properties": {
"schemaFormat": {
"description": "A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.",
"anyOf": [
{
"type": "string"
},
{
"description": "All the schema formats tooling MUST support",
"enum": [
"application/schema+json;version=draft-07",
"application/schema+yaml;version=draft-07",

"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"
]
},
{
"description": "All the schema formats tools are RECOMMENDED to support",
"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",
"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"
]
},
{
"description": "All the schema formats tools are RECOMMENDED to support",
"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",

"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",
"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",

"application/raml+yaml;version=1.0"
]
}
]
}
},
"allOf": [
{
"if": {
"not": {
"description": "If no schemaFormat has been defined, default to schema or reference",
"required": [
"schemaFormat"
]
}
},
"then": {
"properties": {
"schema": {
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json"
}
}
"application/raml+yaml;version=1.0"
]
}
},
{
"if": {
"description": "If schemaFormat has been defined check if it's one of the AsyncAPI Schema Object formats",
"required": [
"schemaFormat"
],
"properties": {
"schemaFormat": {
"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"
]
}
}
},
"then": {
"properties": {
"schema": {
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json"
}
}
}
},
{
"if": {
"required": [
"schemaFormat"
],
"properties": {
"schemaFormat": {
"enum": [
"application/schema+json;version=draft-07",
"application/schema+yaml;version=draft-07"
]
}
}
},
"then": {
"properties": {
"schema": {
"$ref": "http://json-schema.org/draft-07/schema"
}
}
}
},
{
"if": {
]
}
},
"anyOf": [
{
"if": {
"not": {
"description": "If no schemaFormat has been defined, default to schema or reference",
"required": [
"schemaFormat"
],
"properties": {
"schemaFormat": {
"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"
]
}
}
},
"then": {
"properties": {
"schema": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json"
}
]
}
}
]
}
},
{
"if": {
"required": [
"schemaFormat"
],
"properties": {
"schemaFormat": {
"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"
]
}
}
},
"then": {
"properties": {
"schema": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json"
}
]
}
"then": {
"properties": {
"schema": {
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json"
}
}
}
]
},
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/multiFormatAsyncAPISchemaMessage.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/multiFormatOpenAPIMessage.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/multiFormatJsonSchemaMessage.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/multiFormatAvroMessage.json"
}
],
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json"
}
Loading

0 comments on commit 90a2d26

Please sign in to comment.