-
-
Notifications
You must be signed in to change notification settings - Fork 891
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support for discriminator tag lookup in referenced schemas #2262
base: master
Are you sure you want to change the base?
Support for discriminator tag lookup in referenced schemas #2262
Conversation
Is this PR defunct? If you'd consider merging it with changes, I'd be open to contributing the changes back in. We would love to have it support |
let propSch = sch?.properties?.[tagName] | ||
let hasSubSchRequired = false | ||
if (!propSch && sch?.allOf) { | ||
const {hasRequired, propertyObject} = mapDiscriminatorFromAllOf(propSch, sch) |
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.
Re: the GitHubActions warnings, maybe we can rename this key or avoid the destructuring and just use a constant for the returned object and reference each key in the following lines?
E.g.
const discriminator = mapDiscriminatorFromAllOf(propSch, sch)
hasSubSchRequired = discriminator.hasRequired
propSch = discriminator.propertyObject
@mefellows What changes would be necessary to get this merged? I'm happy to send another patch with those included. |
I'm not a maintainer here, I'm just an interested party and are open helping out with direction from the project. |
Whoops, my bad. I confused contributor of the pactflow repo with this one! @epoberezkin would you be able to answer that question? |
if (subSchObj instanceof SchemaEnv) subSchObj = subSchObj.schema | ||
propSch = subSchObj?.properties?.[tagName] | ||
} | ||
if (propSch) { |
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.
is it possible to move the check out of for
? The reason is that currently the first match is applied and it is better to return the last match. Therefore the last override has priority
@epoberezkin any chance we could get this merged / looked at? it's been over a year and for openapi specs that use |
@epoberezkin checking in as well, since we'd like to use |
What issue does this pull request resolve?
#2261
What changes did you make?
Support for discriminator tag lookup in referenced schemas
Is there anything that requires more attention while reviewing?
no