-
Notifications
You must be signed in to change notification settings - Fork 64
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
Initial support of complex schema with manually-added oneOf #174
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #174 +/- ##
==========================================
+ Coverage 96.78% 97.00% +0.21%
==========================================
Files 14 14
Lines 467 500 +33
Branches 102 115 +13
==========================================
+ Hits 452 485 +33
Misses 15 15 ☔ View full report in Codecov by Sentry. |
I've tested this with my setup from #173 and it works beautifully, well done @hss-mateus! 👏🏻 @exoego Have you had a chance to look at this yet? |
That algorithm sounds smart. |
If I understand it correctly, this part of the generated schema is already not found in |
Ah, I overlooked that. |
oneOf
schemas
As reported in #173, manually added
oneOf
attributes are ignored and the generated schema is placed alongside.This PR implements an algorithm that compare the generated schema with every
oneOf
option, merges with the most similar one, or adds a new option if none are sufficiently similar.I placed an abitrary value of 0.5 that represents the minimum similarity score required.
I have to update the
$ref
handling code too, since it was discarding paths inside arrays.