Skip to content

Commit

Permalink
feat: add binding validation (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni authored Feb 1, 2023
1 parent d4d5197 commit f5a2346
Show file tree
Hide file tree
Showing 42 changed files with 3,428 additions and 663 deletions.
11 changes: 10 additions & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,13 @@

# The default owners are automatically added as reviewers when you open a pull request unless different owners are specified in the file.

* @fmvilas @derberg @dalelane @smoya @char0n @asyncapi-bot-eve
* @fmvilas @derberg @dalelane @smoya @char0n @asyncapi-bot-eve


/bindings/anypointmq/ @GeraldLoeffler
/bindings/ibmmq/ @rcoppen
/bindings/kafka/ @lbroudoux @dalelane
/bindings/googlepubsub/ @whitlockjc
/bindings/solace/ @damaru-inc @CameronRushton
/bindings/*.json @KhudaDad414
/bindings/pulsar/ @VisualBean
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/amqp/channel.json",
"$id": "http://asyncapi.com/bindings/amqp/0.2.0/channel.json",
"title": "AMQP channel bindings object",
"description": "This object contains information about the channel representation in AMQP.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension"
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"properties": {
Expand Down Expand Up @@ -80,7 +80,6 @@
],
"description": "The version of this binding. If omitted, 'latest' MUST be assumed."
}

},
"oneOf": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/amqp/message.json",
"$id": "http://asyncapi.com/bindings/amqp/0.2.0/message.json",
"title": "AMQP message bindings object",
"description": "This object contains information about the message representation in AMQP.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension"
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"properties": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/amqp/operation.json",
"$id": "http://asyncapi.com/bindings/amqp/0.2.0/operation.json",
"title": "AMQP operation bindings object",
"description": "This object contains information about the operation representation in AMQP.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension"
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"properties": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/anypointmq/channel.json",
"$id": "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json",
"title": "Anypoint MQ channel bindings object",
"description": "This object contains configuration for describing an Anypoint MQ exchange, queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension"
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"properties": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/anypointmq/message.json",
"$id": "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json",
"title": "Anypoint MQ message bindings object",
"description": "This object contains configuration for describing an Anypoint MQ message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension"
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"properties": {
"headers": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/schema",
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json",
"description": "A Schema object containing the definitions for Anypoint MQ-specific headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of Anypoint MQ protocol headers are 'messageId' and 'messageGroupId'."
},
"bindingVersion": {
Expand Down
88 changes: 88 additions & 0 deletions bindings/googlepubsub/0.1.0/channel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/googlepubsub/0.1.0/channel.json",
"title": "Cloud Pub/Sub Channel Schema",
"description": "This object contains information about the channel representation for Google Cloud Pub/Sub.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"properties": {
"bindingVersion": {
"type": "string",
"enum": [
"0.1.0"
],
"description": "The version of this binding."
},
"labels": {
"type": "object"
},
"messageRetentionDuration": {
"type": "string"
},
"messageStoragePolicy": {
"type": "object",
"additionalProperties": false,
"properties": {
"allowedPersistenceRegions": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"schemaSettings": {
"type": "object",
"additionalItems": false,
"properties": {
"encoding": {
"type": "string"
},
"firstRevisionId": {
"type": "string"
},
"lastRevisionId": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"encoding",
"name"
]
},
"topic": {
"type": "string"
}
},
"required": [
"schemaSettings",
"topic"
],
"examples": [
{
"labels": {
"label1": "value1",
"label2": "value2"
},
"messageRetentionDuration": "86400s",
"messageStoragePolicy": {
"allowedPersistenceRegions": [
"us-central1",
"us-east1"
]
},
"schemaSettings": {
"encoding": "json",
"name": "projects/your-project-id/schemas/your-schema"
}
}
]
}
55 changes: 55 additions & 0 deletions bindings/googlepubsub/0.1.0/message.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/googlepubsub/0.1.0/message.json",
"title": "Cloud Pub/Sub Channel Schema",
"description": "This object contains information about the message representation for Google Cloud Pub/Sub.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"properties": {
"bindingVersion": {
"type": "string",
"enum": [
"0.1.0"
],
"description": "The version of this binding."
},
"attributes": {
"type": "object"
},
"orderingKey": {
"type": "string"
},
"schema": {
"type": "object",
"additionalItems": false,
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": ["name", "type"]
}
},
"examples": [
{
"schema": {
"name": "projects/your-project-id/schemas/your-avro-schema-id",
"type": "avro"
}
},
{
"schema": {
"name": "projects/your-project-id/schemas/your-protobuf-schema-id",
"type": "protobuf"
}
}
]
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/http/message.json",
"$id": "http://asyncapi.com/bindings/http/0.1.0/message.json",
"title": "HTTP message bindings object",
"description": "This object contains information about the message representation in HTTP.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension"
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"properties": {
"headers": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/schema",
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json",
"description": "\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key."
},
"bindingVersion": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/http/operation.json",
"$id": "http://asyncapi.com/bindings/http/0.1.0/operation.json",
"title": "HTTP operation bindings object",
"description": "This object contains information about the operation representation in HTTP.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension"
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"properties": {
Expand Down Expand Up @@ -35,7 +35,7 @@
"description": "When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'."
},
"query": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/schema",
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json",
"description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key."
},
"bindingVersion": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/ibmmq/channel.json",
"$id": "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json",
"title": "IBM MQ channel bindings object",
"description": "This object contains information about the channel representation in IBM MQ. Each channel corresponds to a Queue or Topic within IBM MQ.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension"
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"properties": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/ibmmq/message.json",
"$id": "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json",
"title": "IBM MQ message bindings object",
"description": "This object contains information about the message representation in IBM MQ.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension"
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"properties": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/ibmmq/server.json",
"$id": "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json",
"title": "IBM MQ server bindings object",
"description": "This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension"
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"properties": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/kafka/message.json",
"$id": "http://asyncapi.com/bindings/kafka/0.1.0/message.json",
"title": "Kafka message bindings object",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension"
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"properties": {
"key": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/schema",
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json",
"description": "The message key."
},
"bindingVersion": {
Expand Down
Loading

0 comments on commit f5a2346

Please sign in to comment.