Support reader schema when decoding avro #166
Merged
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.
I can't push to invitae:add-avro-schema-resolution, so I'm opening up this as a continuation of #137
This changes the proposed interface slightly, as to not pollute non-Avro decoding with a
readerSchema
option that does nothing. It also tries to minimize the amount of types used directly from avsc and instead favors our own Schema types were possible. The reason for this is twofold:Type
type isn't compatible with the old version, users would be restricted to the version we depend on, even if the actual changes don't affect us.readAvsc
etc) and use those as reader schemas. This means that we internally turn them into avscType
instances when they are used as reader schemas.This means that the interface becomes:
This also ensures that the same schema type options from the constructor are used when constructing the
Type
to use for decoding (i.e. the avsc options).FYI @ivan-klass