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
oneOfattributes are ignored and the generated schema is placed alongside.This PR implements an algorithm that compare the generated schema with every
oneOfoption, 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
$refhandling code too, since it was discarding paths inside arrays.