You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Not sure if I understand correctly, for me it seems the discriminator should only exist on the parent schema, and not the child, where the discriminator mapping map the value it has to the child type/$ref. If I am interpreting correctly, it seems the test cases for discriminator are having some issues, eg discriminator > oneOf, the child having discriminator, discriminator > allOf the child having discriminator and point to the parent
Just so I’m clear, could you point to the specific test you’re referring to, and what you think the correct output types should be?
In general, though, there’s not really a “parent–child” relationship when it comes to composition. When you mark something as allOf you are really just extending that object. I don’t think it’s accurate to call it a “child” node because they’re both on the same level; you’re just saving yourself some typing. So I think you’re intentionally not redeclaring a discriminator when using composition.
But I may be off the mark / missing something. Happy to talk through a more specific example of what’s generated today vs. what you expect to happen if you provide one
This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.
Description
Not sure if I understand correctly, for me it seems the discriminator should only exist on the parent schema, and not the child, where the discriminator mapping map the value it has to the child type/$ref. If I am interpreting correctly, it seems the test cases for discriminator are having some issues, eg discriminator > oneOf, the child having discriminator, discriminator > allOf the child having discriminator and point to the parent
may related to #1158
openapi-typescript
7.0.0-next.0
18.12.0
Windows 10
Checklist
npx @redocly/cli@latest lint
)The text was updated successfully, but these errors were encountered: