-
Notifications
You must be signed in to change notification settings - Fork 209
fix: correctly generate anyOf on unions with string and boolean constant #2208
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
base: next
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,27 @@ | |
] | ||
}, | ||
"type": "array" | ||
}, | ||
"var7": { | ||
"anyOf": [ | ||
{ | ||
"type": "string" | ||
}, | ||
{ | ||
"const": true, | ||
"type": "boolean" | ||
} | ||
] | ||
}, | ||
"var8": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm unsure if we can use I'd bet that even if allowed, this would break in a lot of community parsers. Could we make this be a anyOf There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn’t this the analog case for var4 and var6, apart from using a |
||
"enum": [ | ||
"s", | ||
true | ||
], | ||
"type": [ | ||
"string", | ||
"boolean" | ||
] | ||
} | ||
}, | ||
"required": [ | ||
|
@@ -78,7 +99,9 @@ | |
"var3", | ||
"var4", | ||
"var5", | ||
"var6" | ||
"var6", | ||
"var7", | ||
"var8" | ||
], | ||
"type": "object" | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.