Skip to content

Commit e4ae515

Browse files
authored
[Schema Registry] Include name and groupName in SchemaProperties (Azure#21298)
### Packages impacted by this PR @azure/schema-registry ### Issues associated with this PR Fixes Azure#21294 ### Describe the problem that is addressed by this PR These properties can help customers register updated versions of schemas based on previously registered ones because `name` and `groupName` are required by `registerSchema`. ### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen? N/A ### Are there test cases added in this PR? _(If not, why?)_ N/A ### Provide a list of related PRs _(if any)_ N/A ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ ### Checklists - [x] Added impacted package name to the issue description - [ ] Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ - [x] Added a changelog (if necessary)
1 parent 4212ed6 commit e4ae515

File tree

13 files changed

+66
-14
lines changed

13 files changed

+66
-14
lines changed

sdk/schemaregistry/schema-registry-avro/test/public/utils/mockedRegistryClient.ts

+2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ function createMockedTestRegistry(): SchemaRegistry {
7373
properties: {
7474
id: newId(),
7575
format: schema.format,
76+
groupName: schema.groupName,
77+
name: schema.name,
7678
},
7779
};
7880
mapByContent.set(result.definition, result);

sdk/schemaregistry/schema-registry/CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Release History
22

3-
## 1.0.2 (Unreleased)
3+
## 1.1.0 (Unreleased)
44

55
### Features Added
6+
67
- Added support for distributed tracing using OpenTelemetry - please refer to the [@azure/opentelemetry-instrumentation-azure-sdk](https://www.npmjs.com/package/@azure/opentelemetry-instrumentation-azure-sdk) package for instructions.
78

89
### Breaking Changes
@@ -11,6 +12,8 @@
1112

1213
### Other Changes
1314

15+
- `SchemaProperties` now includes `name` and `groupName` for the schema name and its group respectively.
16+
1417
## 1.0.1 (2021-11-17)
1518

1619
### Bugs Fixed

sdk/schemaregistry/schema-registry/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@azure/schema-registry",
3-
"version": "1.0.2",
3+
"version": "1.1.0",
44
"description": "Schema Registry Library with typescript type definitions for node.js and browser.",
55
"sdk-type": "client",
66
"main": "dist/index.js",

sdk/schemaregistry/schema-registry/review/schema-registry.api.md

+2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ export interface SchemaDescription {
3737
// @public
3838
export interface SchemaProperties {
3939
format: string;
40+
groupName: string;
4041
id: string;
42+
name: string;
4143
}
4244

4345
// @public

sdk/schemaregistry/schema-registry/src/constants.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ export const DEFAULT_SCOPE = "https://eventhubs.azure.net/.default";
99
/**
1010
* @internal
1111
*/
12-
export const SDK_VERSION = "1.0.2";
12+
export const SDK_VERSION = "1.1.0";

sdk/schemaregistry/schema-registry/src/conversions.ts

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export async function convertSchemaResponse(response: GeneratedSchemaResponse):
3232
properties: {
3333
id: response.schemaId!,
3434
format: mapContentTypeToFormat(response.contentType!),
35+
groupName: response.schemaGroupName!,
36+
name: response.schemaName!,
3537
},
3638
};
3739
}
@@ -50,6 +52,8 @@ export function convertSchemaIdResponse(
5052
// is not modeled by the generated client.
5153
id: response.schemaId!,
5254
format: schemaFormat,
55+
groupName: response.schemaGroupName!,
56+
name: response.schemaName!,
5357
};
5458
};
5559
}

sdk/schemaregistry/schema-registry/src/generated/generatedSchemaRegistryClient.ts

+37-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/schemaregistry/schema-registry/src/generated/index.ts

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/schemaregistry/schema-registry/src/generated/operations/schema.ts

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/schemaregistry/schema-registry/src/generated/operations/schemaGroupsOperations.ts

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/schemaregistry/schema-registry/src/models.ts

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ export interface SchemaProperties {
1515
* Currently only 'avro' is supported, but this is subject to change.
1616
*/
1717
format: string;
18+
19+
/** Schema group under which schema is or should be registered. */
20+
groupName: string;
21+
22+
/** Name of schema.*/
23+
name: string;
1824
}
1925

2026
/**

sdk/schemaregistry/schema-registry/swagger/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ https://github.com/Azure/azure-rest-api-specs/pull/10220 is merged.
1010
```yaml
1111
v3: true
1212
package-name: "@azure/schema-registry"
13-
package-version: 1.0.2
13+
package-version: 1.1.0
1414
title: GeneratedSchemaRegistryClient
1515
description: Generated Schema Registry Client
1616
generate-metadata: false

sdk/schemaregistry/schema-registry/test/public/schemaRegistry.spec.ts

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ function assertIsValidSchemaProperties(
3535
): asserts schemaProperties {
3636
assert.isNotEmpty(schemaProperties.id);
3737
assert.equal(schemaProperties.format, expectedSerializationType);
38+
assert.isNotEmpty(schemaProperties.groupName);
39+
assert.isNotEmpty(schemaProperties.name);
3840
}
3941

4042
function assertIsValidSchema(schema: Schema, expectedSerializationType = "Avro"): asserts schema {

0 commit comments

Comments
 (0)