Add support for Snowplow's self-describing schemas #541
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.
Many companies use Snowplow Analytics to manage their events. Snowplow uses a specific JSON schema structure (iglu) that involves a concept of self-describing schemas. These schemas use a
self
property to add information about what version or name etc the event is. In extension this means that snowplow schemas typically don't include$id
ortitle
fields, as you can see in this official example: https://github.com/snowplow/iglu-example-schema-registry/blob/master/schemas/com.example_company/example_event/jsonschema/1-0-0.In the above example project's file structure (that many companies follow) we can't fall back on the file name either since it will be represented as numbers (not valid interface names).
This PR adds support to transform the self.name field to the schema title via the normalizer, which should be favourable when using snowplow/iglu schemas.
For reviewers
self
property exists and assume that's a value that contains "name" and then delete the whole "self" property. I'm happy to revise this if you think it will collide with other peoples use of this library, if its too unsafe or if you'd like to decorate further information from the self etc. Open to suggestions :))yarn.lock
when runningnpx yarn
(with the node version specified in the.nvmrc
)