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

API SchemaRegistryClient updates #24529

Merged
merged 15 commits into from
Oct 4, 2021

Conversation

conniey
Copy link
Member

@conniey conniey commented Oct 4, 2021

Updates based on API Review:

  • Adding class SchemaRegistrySchema
    • Moving from using bytes to a String to represent schema.
  • SchemaProperties no longer has schema content nor schema name.
  • Update getSchemaId to getSchemaProperties
  • Add withResponse methods back to schema clients.
  • Change contents -> schemaDefinition

Related: #24221
API View: https://apiview.dev/Assemblies/Review/0615cbf9af5e4f5caa0b113ae279492e

@conniey conniey requested review from sjkwak and srnagar as code owners October 4, 2021 21:28
@ghost ghost added the Schema Registry label Oct 4, 2021
@conniey conniey self-assigned this Oct 4, 2021
sdk/schemaregistry/azure-data-schemaregistry/README.md Outdated Show resolved Hide resolved
*
* @return The content of the schema.
*/
public String getContent() {
Copy link
Member

Choose a reason for hiding this comment

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

Since we are calling this schemaDefinition in the registerSchema API, we should use the same terminology here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call. I relayed this to @deyaaeldeen .

*
* @param schemaId the schema id
* @param schemaFormat type of schema, e.g. avro, json
* @param schemaName name of the schema.
Copy link
Member

Choose a reason for hiding this comment

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

Why did we remove the schemaName?

Copy link
Member Author

Choose a reason for hiding this comment

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

AFAIK, none of the other languages had this parameter. It used to always return null, and I had to add some regex magic to parse it from the returned headers.
ex: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/schemaregistry/Azure.Data.SchemaRegistry/src/SchemaProperties.cs

Copy link
Member

Choose a reason for hiding this comment

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

This might be worth asking the service team to include schemaName in their response.

Copy link
Member Author

Choose a reason for hiding this comment

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

@deyaaeldeen . IIRC, we asked the service team about this?

Copy link
Member

Choose a reason for hiding this comment

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

I do not believe but we can discuss this in our next sync. For now, all languages do not have it so let's remove it in Java as well.

@azure-sdk
Copy link
Collaborator

API changes have been detected in com.azure:azure-data-schemaregistry. You can review API changes here

*
* @param schemaId the schema id
* @param schemaFormat type of schema, e.g. avro, json
* @param schemaName name of the schema.
Copy link
Member

Choose a reason for hiding this comment

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

This might be worth asking the service team to include schemaName in their response.

*/
public SchemaRegistrySchema(SchemaProperties properties, String schemaDefinition) {
this.properties = properties;
this.content = schemaDefinition;
Copy link
Member

Choose a reason for hiding this comment

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

nit: use the same name for instance property too

Suggested change
this.content = schemaDefinition;
this.schemaDefinition = schemaDefinition;

@azure-sdk
Copy link
Collaborator

API changes have been detected in com.azure:azure-data-schemaregistry. You can review API changes here

API changes

-         public SchemaRegistrySchema(SchemaProperties properties, String content) 
-         public String getContent() 
+         public SchemaRegistrySchema(SchemaProperties properties, String schemaDefinition) 
+         public String getSchemaDefinition() 

@conniey conniey merged commit ebc71be into Azure:main Oct 4, 2021
@conniey conniey deleted the schema-registry/add-response-methods branch October 4, 2021 22:39
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.

4 participants