Skip to content

Migrating Schema Registry from AutoRest to Typespec#49275

Open
conniey wants to merge 29 commits into
Azure:mainfrom
conniey:schemaregistry/typescript
Open

Migrating Schema Registry from AutoRest to Typespec#49275
conniey wants to merge 29 commits into
Azure:mainfrom
conniey:schemaregistry/typescript

Conversation

@conniey
Copy link
Copy Markdown
Member

@conniey conniey commented May 26, 2026

Description

  • Updates schema registry from using Autorest to Typespec
  • Updates test-resources.json to not use local auth to adhere to policy.
  • Updates test recordings

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings May 26, 2026 22:45
@conniey conniey requested review from a team, axisc, hmlam and sjkwak as code owners May 26, 2026 22:45
@conniey conniey force-pushed the schemaregistry/typescript branch from c422716 to cfaca22 Compare May 26, 2026 22:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates azure-data-schemaregistry from AutoRest-generated implementation code to TypeSpec-generated code and updates Schema Registry test infrastructure to use Azure AD authentication instead of local auth.

Changes:

  • Replaces AutoRest swagger/config and generated implementation classes with TypeSpec generation metadata, tsp-location.yaml, and SchemaRegistryClientImpl.
  • Updates public/internal Schema Registry clients, builder, service version enum, and helper header parsing to use the new generated implementation.
  • Updates tests, recordings assets, and Event Hubs test resources for token-credential-based authentication.

Reviewed changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
sdk/schemaregistry/test-resources.json Disables local auth and removes SAS authorization output.
sdk/schemaregistry/azure-data-schemaregistry/tsp-location.yaml Adds TypeSpec source location.
sdk/schemaregistry/azure-data-schemaregistry/swagger/README.md Removes AutoRest generation config.
sdk/schemaregistry/azure-data-schemaregistry/src/test/java/com/azure/data/schemaregistry/SchemaRegistryAsyncClientTests.java Updates async tests for new service version/logging.
sdk/schemaregistry/azure-data-schemaregistry/src/test/java/com/azure/data/schemaregistry/SchemaRegistryAsyncClientPlaybackTests.java Renames service version enum usage.
sdk/schemaregistry/azure-data-schemaregistry/src/test/java/com/azure/data/schemaregistry/generated/SchemaRegistryClientTestBase.java Adds generated test base.
sdk/schemaregistry/azure-data-schemaregistry/src/samples/java/com/azure/data/schemaregistry/SchemaRegistryClientJavaDocCodeSnippets.java Updates logging sample.
sdk/schemaregistry/azure-data-schemaregistry/src/main/resources/META-INF/azure-data-schemaregistry_metadata.json Adds TypeSpec metadata.
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/module-info.java Marks module as TypeSpec-generated.
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/SchemaRegistryVersion.java Removes old service version enum.
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/SchemaRegistryServiceVersion.java Adds new service version enum.
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/SchemaRegistryClientBuilder.java Reworks builder for TypeSpec impl.
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/SchemaRegistryClient.java Updates sync client to new impl.
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/SchemaRegistryAsyncClient.java Updates async client to new impl.
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/package-info.java Formatting/doc cleanup.
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/implementation/SchemasImpl.java Removes AutoRest schemas implementation.
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/implementation/SchemaRegistryHelper.java Consolidates header parsing.
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/implementation/SchemaRegistryClientImpl.java Adds TypeSpec generated REST implementation.
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/implementation/SchemaGroupsOperationsImpl.java Removes AutoRest schema groups implementation.
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/implementation/package-info.java Minor formatting cleanup.
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/implementation/models/SchemasRegisterHeaders.java Removes old header model.
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/implementation/models/SchemasQueryIdByContentHeaders.java Removes old header model.
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/implementation/models/SchemasGetSchemaVersionHeaders.java Removes old header model.
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/implementation/AzureSchemaRegistryImpl.java Removes old AutoRest root implementation.
sdk/schemaregistry/azure-data-schemaregistry/assets.json Updates Schema Registry recording assets tag.
sdk/schemaregistry/azure-data-schemaregistry-apacheavro/src/test/java/com/azure/data/schemaregistry/apacheavro/SchemaRegistryApacheAvroSerializerIntegrationTest.java Switches Event Hubs integration test to token credential auth.
sdk/schemaregistry/azure-data-schemaregistry-apacheavro/assets.json Updates apacheavro recording assets tag.
Comments suppressed due to low confidence (1)

sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/SchemaRegistryClient.java:59

  • This accessor now calls itself recursively, so any caller of getFullyQualifiedNamespace() will hit a StackOverflowError. It should delegate to the generated service client, matching the async client implementation.
 *     .buildClient();

/**
* Service version of SchemaRegistryClient.
*/
public enum SchemaRegistryServiceVersion implements ServiceVersion {
.withContext(context -> service.listSchemaGroups(this.getFullyQualifiedNamespace(),
this.getServiceVersion().getVersion(), accept, requestOptions, context))
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "Value"), getNextLink(res.getValue(), "NextLink"), null));
.withContext(context -> service.listSchemaVersions(this.getFullyQualifiedNamespace(),
this.getServiceVersion().getVersion(), groupName, schemaName, accept, requestOptions, context))
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "Value"), getNextLink(res.getValue(), "NextLink"), null));
Comment on lines 184 to 185
URL url = (new URI(fullyQualifiedNamespace)).toURL();
this.fullyQualifiedNamespace = url.getHost();
try {
final URL url = new URI(fullyQualifiedNamespace).toURL();
fullyQualifedNamespaceToUse = url.getHost();
} catch (MalformedURLException | URISyntaxException e) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants