-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Allow Singer schemas to include the required
and enum
fields
#917
fix: Allow Singer schemas to include the required
and enum
fields
#917
Conversation
Codecov Report
@@ Coverage Diff @@
## main #917 +/- ##
==========================================
+ Coverage 80.40% 80.66% +0.26%
==========================================
Files 34 35 +1
Lines 3429 3476 +47
Branches 681 692 +11
==========================================
+ Hits 2757 2804 +47
Misses 499 499
Partials 173 173
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Hi @Jack-Burnett! Thanks for the PR. I'll take a look in the next few days 😺 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jack-Burnett this is looking great!
I initially missed those pylint comments which we don't need. Once that's addressed this is g2g 🙂
Co-authored-by: Edgar R. M. <[email protected]>
Co-authored-by: Edgar R. M. <[email protected]>
Co-authored-by: Edgar R. M. <[email protected]>
Co-authored-by: Edgar R. M. <[email protected]>
required
and enum
fields
Ohh yeah just lazy copy-pasting on my part 😅 All gone now |
Thank you @Jack-Burnett! |
Closes #901
The use of the Schema class from a dependency was limiting schemas to only include certain declared json schema fields, since it would remove properties if they were not whitelisted. Since this is from a dependency, we can't simply expand the whitelist so instead we override the class and expand the list there. An alternative implementation would be to simply replace the class outright (no inheritance) - this could break existing taps that pass a Schema to Stream.init though.
It helps with but does not close #332, since 332 is asking for helpers, which this does not add - it makes it possible to add them though.
I think there are lots more improvements that could be made to SchemaPlus in follow-up PRs (adding many more legitimate properties to the whitelist and having better support for some non-simple properties.
Also, I removed the 'selected' and 'inclusion' fields from the new class - because they are part of the singer spec and not actually valid fields to see on a json schema.