confluent-kafka-python
confluent-kafka-python copied to clipboard
Add `SchemaRegistryClient` methods for all schema/subject REST endpoints
When using the SchemaRegistryClient class, we find that its methods for working with schemas and subjects are not consistently covering the Schema Registry REST API.
Below are listed all the Schemas and Subjects REST endpoints, together with the Python methods that uses them:
| REST API endpoints | SchemaRegistryClient methods | |
|---|---|---|
| Schemas: | - | - |
| GET | /schemas/types | get_schema_types() (PROPOSED) |
| GET | /schemas/ids/{id} | get_schema(schema_id) |
| GET | /schemas/ids/{id}/versions | get_schema_versions(schema_id) (PROPOSED) |
| Subjects: | - | - |
| GET | /subjects | get_subjects() |
| POST | /subjects/{subject} (query) | lookup_schema(subject_name, schema, ...) |
| DELETE | /subjects/{subject} | delete_subject(subject_name, permanent) |
| POST | /subjects/{subject}/versions (create) | register_schema(subject_name, schema, ...) |
| GET | /subjects/{subject}/versions | get_versions(subject_name) |
| GET | /subjects/{subject}/versions/{version} | get_version(subject_name, version) get_latest_version(subject_name) |
| DELETE | /subjects/{subject}/versions/{version} | delete_version(subject_name, version) |
| GET | /subjects/{subject}/versions/{version}/schema | get_schema_by_subject_version(subject_name, version) (PROPOSED) |
| GET | /subjects/{subject}/versions/{version}/referencedby | get_referencedby(subject_name, version) (PROPOSED) |
I would recommend we implement the PROPOSED entries. Any preferred naming conventions for method names?
Note: The Mode/Compatibility/Config/Exporters endpoints are not scoped in this proposal.
EDIT: Sorted table on endpoint; Map lookup_schema correctly. Added PROPOSED methods.
yep, it would be good to have full coverage.
note that these methods were not implemented in order to limit scope, in order to get the feature out. we will have bandwidth to review a PR fairly quickly if it doesn't require much time (is high quality, doesn't involve design issues that require thought). otherwise just warning that it might sit there for a bit.
Great @mhowlett, I will give it a go!
Ping @mhowlett
thanks! noted.