Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add binding validation #239

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines +12 to +18
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a friendly reminder, you will need to invite all as contributors once it's fully merged 🙂

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you also ping these maintainers in asyncapi/bindings#113 so they are aware 🙏🏼

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do once merged 👍

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