Skip to content
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 non-nullable type with two options #205

Merged
merged 2 commits into from
Apr 16, 2024

Conversation

jagregory
Copy link
Contributor

If you have a type with exactly two options, neither of which is null, then the null-checking logic incorrectly uses the last item in the list as the type instead of interface{}.

e.g. "type": ["string", "boolean"] becomes *bool instead of interface{} because the generation logic is assuming a two item type is only used when setting a type to null.

If you have a type with exactly two options, neither of which is null,
then the null-checking logic incorrectly uses the last item in the list
as the type instead of interface{}.

e.g. `"type": ["string", "boolean"]` becomes `*bool` instead of `interface{}`
Copy link

codecov bot commented Mar 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.28%. Comparing base (d963216) to head (d9668fc).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #205      +/-   ##
==========================================
+ Coverage   76.58%   78.28%   +1.69%     
==========================================
  Files          24       24              
  Lines        1892     1515     -377     
==========================================
- Hits         1449     1186     -263     
+ Misses        354      240     -114     
  Partials       89       89              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@omissis omissis merged commit 83bd689 into omissis:main Apr 16, 2024
3 checks passed
@omissis omissis added this to the v0.16.0 milestone Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants