From 94f0c953318904d358058c33fa5fa0364ea56612 Mon Sep 17 00:00:00 2001 From: Jeremy Whitlock Date: Thu, 27 Jul 2023 10:46:18 -0400 Subject: [PATCH] feat: add googlepubsub bindings for v3 --- bindings/googlepubsub/0.2.0/channel.json | 84 ++++++++++++++++++++ bindings/googlepubsub/0.2.0/message.json | 50 ++++++++++++ definitions/3.0.0/channelBindingsObject.json | 8 +- definitions/3.0.0/messageBindingsObject.json | 8 +- 4 files changed, 142 insertions(+), 8 deletions(-) create mode 100644 bindings/googlepubsub/0.2.0/channel.json create mode 100644 bindings/googlepubsub/0.2.0/message.json diff --git a/bindings/googlepubsub/0.2.0/channel.json b/bindings/googlepubsub/0.2.0/channel.json new file mode 100644 index 00000000..3f63e2ab --- /dev/null +++ b/bindings/googlepubsub/0.2.0/channel.json @@ -0,0 +1,84 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/googlepubsub/0.2.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.2.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" + ] + } + }, + "required": [ + "schemaSettings" + ], + "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" + } + } + ] +} \ No newline at end of file diff --git a/bindings/googlepubsub/0.2.0/message.json b/bindings/googlepubsub/0.2.0/message.json new file mode 100644 index 00000000..4fa0dc44 --- /dev/null +++ b/bindings/googlepubsub/0.2.0/message.json @@ -0,0 +1,50 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/googlepubsub/0.2.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.2.0" + ], + "description": "The version of this binding." + }, + "attributes": { + "type": "object" + }, + "orderingKey": { + "type": "string" + }, + "schema": { + "type": "object", + "additionalItems": false, + "properties": { + "name": { + "type": "string" + } + }, + "required": ["name"] + } + }, + "examples": [ + { + "schema": { + "name": "projects/your-project-id/schemas/your-avro-schema-id", + } + }, + { + "schema": { + "name": "projects/your-project-id/schemas/your-protobuf-schema-id", + } + } + ] +} \ No newline at end of file diff --git a/definitions/3.0.0/channelBindingsObject.json b/definitions/3.0.0/channelBindingsObject.json index c5941fe5..d99585f9 100644 --- a/definitions/3.0.0/channelBindingsObject.json +++ b/definitions/3.0.0/channelBindingsObject.json @@ -209,7 +209,7 @@ "googlepubsub": { "properties": { "bindingVersion": { - "enum": ["0.1.0"] + "enum": ["0.2.0"] } }, "allOf": [ @@ -223,7 +223,7 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/googlepubsub/0.1.0/channel.json" + "$ref": "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json" } }, { @@ -231,12 +231,12 @@ "required": [ "bindingVersion" ], "properties": { "bindingVersion": { - "const": "0.1.0" + "const": "0.2.0" } } }, "then": { - "$ref": "http://asyncapi.com/bindings/googlepubsub/0.1.0/channel.json" + "$ref": "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json" } } ] diff --git a/definitions/3.0.0/messageBindingsObject.json b/definitions/3.0.0/messageBindingsObject.json index e8813db6..23fb26c4 100644 --- a/definitions/3.0.0/messageBindingsObject.json +++ b/definitions/3.0.0/messageBindingsObject.json @@ -256,7 +256,7 @@ "googlepubsub": { "properties": { "bindingVersion": { - "enum": ["0.1.0"] + "enum": ["0.2.0"] } }, "allOf": [ @@ -270,7 +270,7 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/googlepubsub/0.1.0/message.json" + "$ref": "http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json" } }, { @@ -278,12 +278,12 @@ "required": [ "bindingVersion" ], "properties": { "bindingVersion": { - "const": "0.1.0" + "const": "0.2.0" } } }, "then": { - "$ref": "http://asyncapi.com/bindings/googlepubsub/0.1.0/message.json" + "$ref": "http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json" } } ]