Skip to content

Conversation

@th0ger
Copy link

@th0ger th0ger commented Sep 26, 2022

Add missing methods to SchemaRegistryClient for REST API :

  • get_schema_types() -> list(str)
  • get_schema_versions(schema_id: int) -> list(dict)
  • get_schema_by_subject_version(subject_name:str, version:int) -> Schema - needs discussion
  • get_referencedby(subject_name:str, version:int) -> list(int)

Updated

  • Unit tests
  • Integration tests
  • Documentation

Closes #1429

@th0ger th0ger requested a review from a team as a code owner September 26, 2022 06:48
@th0ger
Copy link
Author

th0ger commented Sep 26, 2022

Hi @mhowlett :-)

I would like some feedback on the get_schema_by_subject_version method, see commit c1c41ba

The method name was the best I could come up with within the existing namespace. Let me know if this is ok.

The return type Schema(), which I initially selected to mimic the existing get_schema()-> Schema method, may not be optimal:

  • The REST API simply returns the "unencoded schema string", so the method may add to much complexity.
  • We don't know the schema type from the single REST call (I hardcoded AVRO), so we need an additional roundtrip to fetch the actual type.

Also note, the requests lib converts the unescaped json str (for type=AVRO/JSON) to a python dict, which must be cast back to a str. This results in a format change (newline/whitespace). Can/should we avoid this str->json->dict->str round-trip?

I think we should go with str (unescaped) return type instead, but want your feedback first.

@th0ger th0ger force-pushed the add-schemaregistryclient-methods-1429 branch from c1c41ba to ea06295 Compare September 26, 2022 07:52
@CLAassistant
Copy link

CLAassistant commented Sep 26, 2022

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@th0ger
Copy link
Author

th0ger commented May 17, 2023

@rayokota rayokota added the component:schema-registry Any schema registry related isues rather than kafka isolated ones label Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:schema-registry Any schema registry related isues rather than kafka isolated ones

3 participants