Only include schemaType and References when needed #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Older versions of the Confluent Schema Registry API don't support fields
schemaType
orReferences
. Right now, this package always includes these in requests, even if they aren't being used. Since these fields were added to the API, the documentation has stated that they are optional fields. And it's documented thatschemaType
is always assumed to be Avro when it isn't specified.This PR ensures that these fields are only included in the request when they're not empty. And it does this with minimal changes to the package.
I need this behavior in order to use this package for my use case. And I've found a few previous issues that had problems that this PR would address:
#11 #19 #21
In addition to the unit tests added in this PR, I've also tested these changes with integration tests specific to my use case.
Please feel free to mention any questions or concerns.