Skip to content

Support fully-qualified refs as discriminator mapping values #1017

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

Merged
merged 3 commits into from
Feb 23, 2023

Conversation

sgrimm
Copy link
Contributor

@sgrimm sgrimm commented Dec 12, 2022

Changes

Fixes #1016

How to Review

I took my best guess at what the test for this should look like based on the existing test suite. The new test does demonstrate the bug (fails in the same way as my real-world case, passes with the code change). But it feels a bit brittle to me, in that it's hardwiring a bunch of context and the source of the original bug was a mismatch between what was really in that context and what the code expected to be there.

Happy to revise this if you think the test isn't adequate.

Checklist

  • Unit tests updated
  • README updated
  • examples/ directory updated (if applicable)

@sgrimm sgrimm changed the title Use discriminator mapping key as property value Support fully-qualified refs as discriminator mapping values Jan 4, 2023
Copy link
Contributor

@drwpow drwpow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great test. Thank you!

@drwpow drwpow merged commit 69a9c84 into openapi-ts:main Feb 23, 2023
@drwpow
Copy link
Contributor

drwpow commented Feb 23, 2023

@all-contributors please add @sgrimm for code, bug, test

@allcontributors
Copy link
Contributor

@drwpow

I've put up a pull request to add @sgrimm! 🎉

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.

Discriminator property uses payload name instead of discriminator value
2 participants