Skip to content

Commit

Permalink
fix: AsyncAPI v3 shows warning in Studio and IntelliJ plugin when ref…
Browse files Browse the repository at this point in the history
…erencing a json schema

Rollback AnySchema and AvroSchema

asyncapi#494
asyncapi/jasyncapi-idea-plugin#49
  • Loading branch information
Pakisan committed Apr 2, 2024
1 parent 52b06c5 commit d34130d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 88 deletions.
21 changes: 7 additions & 14 deletions common/avroSchema_v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@
},
"required": [
"type"
],
"additionalProperties": false
]
},
"customTypeReference": {
"title": "Custom Type",
Expand Down Expand Up @@ -123,8 +122,7 @@
"required": [
"name",
"type"
],
"additionalProperties": false
]
},
"avroRecord": {
"title": "Record",
Expand Down Expand Up @@ -161,8 +159,7 @@
"type",
"name",
"fields"
],
"additionalProperties": false
]
},
"avroEnum": {
"title": "Enum",
Expand Down Expand Up @@ -199,8 +196,7 @@
"type",
"name",
"symbols"
],
"additionalProperties": false
]
},
"avroArray": {
"title": "Array",
Expand Down Expand Up @@ -233,8 +229,7 @@
"required": [
"type",
"items"
],
"additionalProperties": false
]
},
"avroMap": {
"title": "Map",
Expand Down Expand Up @@ -267,8 +262,7 @@
"required": [
"type",
"values"
],
"additionalProperties": false
]
},
"avroFixed": {
"title": "Fixed",
Expand Down Expand Up @@ -302,8 +296,7 @@
"type",
"name",
"size"
],
"additionalProperties": false
]
},
"name": {
"type": "string",
Expand Down
31 changes: 13 additions & 18 deletions definitions/3.0.0/anySchema.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
{
"$id": "http://asyncapi.com/definitions/3.0.0/anySchema.json",
"if": {
"required": [
"schema"
]
},
"then": {
"$ref": "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json"
},
"else": {
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json"
},
"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.",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "An object representing either a Reference, a Schema or a Multi Format Schema",
"oneOf": [
{
"description": "Because of $ref collision in Reference and AsyncAPI Schema(includes $ref from Json Schema)",
"not": {"required": ["schemaFormat", "schema"]},
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json"
},
{
"type": "object",
"required": ["schemaFormat", "schema"],
"not": {"required": ["$ref"]},
"minProperties": 2,
"maxProperties": 2,
"$ref": "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json"
}
]
"$id": "http://asyncapi.com/definitions/3.0.0/anySchema.json"
}
74 changes: 18 additions & 56 deletions schemas/3.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -2736,49 +2736,18 @@
},
"http://asyncapi.com/definitions/3.0.0/anySchema.json": {
"$id": "http://asyncapi.com/definitions/3.0.0/anySchema.json",
"type": "object",
"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": "Schema definition"
},
"$ref": {
"type": "string",
"description": "Reference to schema"
}
"if": {
"required": [
"schema"
]
},
"oneOf": [
{
"description": "Because of $ref collision in Reference and AsyncAPI Schema(includes $ref from Json Schema)",
"not": {
"required": [
"schemaFormat",
"schema"
]
},
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json"
},
{
"type": "object",
"required": [
"schemaFormat",
"schema"
],
"not": {
"required": [
"$ref"
]
},
"minProperties": 2,
"maxProperties": 2,
"$ref": "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json"
}
]
"then": {
"$ref": "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json"
},
"else": {
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json"
},
"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."
},
"http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json": {
"$id": "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json",
Expand Down Expand Up @@ -3336,8 +3305,7 @@
},
"required": [
"type"
],
"additionalProperties": false
]
},
"customTypeReference": {
"title": "Custom Type",
Expand Down Expand Up @@ -3389,8 +3357,7 @@
"required": [
"name",
"type"
],
"additionalProperties": false
]
},
"avroRecord": {
"title": "Record",
Expand Down Expand Up @@ -3427,8 +3394,7 @@
"type",
"name",
"fields"
],
"additionalProperties": false
]
},
"avroEnum": {
"title": "Enum",
Expand Down Expand Up @@ -3465,8 +3431,7 @@
"type",
"name",
"symbols"
],
"additionalProperties": false
]
},
"avroArray": {
"title": "Array",
Expand Down Expand Up @@ -3499,8 +3464,7 @@
"required": [
"type",
"items"
],
"additionalProperties": false
]
},
"avroMap": {
"title": "Map",
Expand Down Expand Up @@ -3533,8 +3497,7 @@
"required": [
"type",
"values"
],
"additionalProperties": false
]
},
"avroFixed": {
"title": "Fixed",
Expand Down Expand Up @@ -3568,8 +3531,7 @@
"type",
"name",
"size"
],
"additionalProperties": false
]
},
"name": {
"type": "string",
Expand Down

0 comments on commit d34130d

Please sign in to comment.