From ccdcd733f5a1c1d79f258f6860cf8b99ea822cac Mon Sep 17 00:00:00 2001 From: Tommy Brunn Date: Wed, 3 Nov 2021 14:44:43 +0100 Subject: [PATCH 1/3] Don't include the schemaType field in API requests when type is Avro Confluent Schema Registry made a backwards incompatible API change without changing the version of the API, so now we have to hack around this. Same thing that was done for the Java client in https://github.com/confluentinc/schema-registry/pull/1288 Fixes #155 --- src/SchemaRegistry.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SchemaRegistry.ts b/src/SchemaRegistry.ts index 3f31ffd..f49d326 100644 --- a/src/SchemaRegistry.ts +++ b/src/SchemaRegistry.ts @@ -136,7 +136,7 @@ export default class SchemaRegistry { const response = await this.api.Subject.register({ subject: subject.name, body: { - schemaType: confluentSchema.type, + schemaType: confluentSchema.type === SchemaType.AVRO ? undefined : confluentSchema.type, schema: confluentSchema.schema, }, }) @@ -234,7 +234,7 @@ export default class SchemaRegistry { const response = await this.api.Subject.registered({ subject, body: { - schemaType: confluentSchema.type, + schemaType: confluentSchema.type === SchemaType.AVRO ? undefined : confluentSchema.schema, schema: confluentSchema.schema, }, }) From 0f7d29a9716d7295456976d1b794e5c64b979d6e Mon Sep 17 00:00:00 2001 From: Tommy Brunn Date: Wed, 3 Nov 2021 14:51:15 +0100 Subject: [PATCH 2/3] Upgrade build agents --- azure-pipelines.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1644e79..70574df 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,7 +21,7 @@ jobs: - job: lint displayName: Lint pool: - vmImage: 'Ubuntu 16.04' + vmImage: 'ubuntu-latest' steps: - task: NodeTool@0 inputs: @@ -34,7 +34,7 @@ jobs: - job: build displayName: Build pool: - vmImage: 'Ubuntu 16.04' + vmImage: 'ubuntu-latest' steps: - task: NodeTool@0 inputs: @@ -48,7 +48,7 @@ jobs: displayName: Tests dependsOn: lint pool: - vmImage: 'Ubuntu 16.04' + vmImage: 'ubuntu-latest' steps: - task: NodeTool@0 inputs: @@ -68,7 +68,7 @@ jobs: - build - unit_tests pool: - vmImage: 'Ubuntu 16.04' + vmImage: 'ubuntu-latest' steps: - task: NodeTool@0 inputs: @@ -95,7 +95,7 @@ jobs: - lint - unit_tests pool: - vmImage: 'Ubuntu 16.04' + vmImage: 'ubuntu-latest' steps: - task: NodeTool@0 inputs: From 84c4db49501f8aecaa17ca3e4505bb4e337c1af2 Mon Sep 17 00:00:00 2001 From: Tommy Brunn Date: Wed, 3 Nov 2021 15:00:43 +0100 Subject: [PATCH 3/3] Fix typo --- src/SchemaRegistry.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SchemaRegistry.ts b/src/SchemaRegistry.ts index f49d326..7a93437 100644 --- a/src/SchemaRegistry.ts +++ b/src/SchemaRegistry.ts @@ -234,7 +234,7 @@ export default class SchemaRegistry { const response = await this.api.Subject.registered({ subject, body: { - schemaType: confluentSchema.type === SchemaType.AVRO ? undefined : confluentSchema.schema, + schemaType: confluentSchema.type === SchemaType.AVRO ? undefined : confluentSchema.type, schema: confluentSchema.schema, }, })