-
Notifications
You must be signed in to change notification settings - Fork 9k
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(json-schema-2020-12-samples): skip anyOf and oneOf while merging schemas #9853
Conversation
I'm not sure if we would ever want to keep these keywords while merging. It looks like we're not doing so for
which is why there was no issue for OpenAPI 3.x. If we were to keep them, I was thinking of moving the deletion to swagger-ui/src/core/plugins/json-schema-2020-12-samples/fn/main.js Lines 359 to 369 in 8c43f17
do something like: const itemsWIthoutAnyOf = { ...items }
delete itemsWithoutAnyOf.anyOf
sampleArray.push(
...items.anyOf.map((i) =>
sampleFromSchemaGeneric(
merge(i, itemsWithoutAnyOf, config),
config,
undefined,
respectXML
)
)
) but it looks like we would need to do that in a few places in that function. |
const { anyOf, ...itemsWithoutanyOf } = items |
We'll go with the suggestion of contectual handling instead of embedding withing the merge function where it technically does't belong. |
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.
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.
Thanks for the changes!
Refs #9198