-
Notifications
You must be signed in to change notification settings - Fork 69
fix: better determination of oneOf for hash arrays in hash arrays
#269
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
Conversation
| merged_schema | ||
| end | ||
|
|
||
| def build_merged_schema_from_variations(variations) |
Check notice
Code scanning / Rubocop
A calculated magnitude based on number of assignments, branches, and conditions. Note
| merged_schema | ||
| end | ||
|
|
||
| def build_merged_schema_from_variations(variations) |
Check notice
Code scanning / Rubocop
A complexity metric that is strongly correlated to the number of test cases needed to validate a method. Note
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #269 +/- ##
==========================================
- Coverage 97.26% 94.68% -2.58%
==========================================
Files 20 20
Lines 695 734 +39
Branches 163 185 +22
==========================================
+ Hits 676 695 +19
- Misses 19 39 +20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2ee508c to
48c8dd4
Compare
48c8dd4 to
6bf759a
Compare
I'm not sure why overall project coverage is down when my branch has 100% coverage... |
exoego
left a comment
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.
LGTM
Thank you
Summary
Fixes #270
When a nested entry inside a response contained multiple possible types, we were only ever returning the first one. For example:
For this, the
idinoptionswas being marked astype: string, when it should have beenoneOf: string | numberThis PR changes that, so now we get
{ "options": { "type": "array", "items": { "type": "object", "properties": { "id": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "label": { "type": "string" } }, "required": [ "id", "label" ] } } }Additionally I've added more tests to cover different response shapes to try and ensure any further complexities are covered (along with simple versions), and to ensure all paths of the new code are covered. These may be excessive and I'm happy to cut back if desired.