Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements support for the TypeScript 4.9 'satisfies' operator. I did the following:
Created a new
SubNodeParser
to handlets.SatisfiesExpression
nodes. It just resolves to the type of it's expression, ignoring the satisfies type. There is some argument to be made that the type should resolve to the satisfies type, and not the type of the expression, since the satisfied type is often narrower than the declared or inferred type, but I decided to preserve the current behavior rather than introduce some new semantics to the schema generation.I added the new node type to the
chainNodeParer
in the parser factoy.I added a test to
valid-data-type.test.js
that verifies that a schema is successfully generated based on the expression's type, rather than throwing anUnknownNodeError
.All tests pass, and there are no linting warnings or errors.
I'm pretty sure I followed all of the current patterns, but I'm happy to make any adjustments.
Thanks for maintaining!
closes #1532
Version
Published prerelease version:
v1.3.0-next.9
Changelog
🎉 This release contains work from new contributors! 🎉
Thanks for all your work!
❤️ Amy J. Ko (@amyjko)
❤️ Code From Anywhere (@CodeFromAnywhere)
❤️ Chris (@cengels)
❤️ Grigas (@grigasp)
❤️ Mario DeSousa (@mdesousa)
❤️ Grant Dickinson (@grant-d)
🚀 Enhancement
discriminatorOpenApi
tag to generatediscriminator
schemas #1572 (@mdesousa)🐛 Bug Fix
enum
type discriminators when using the@discriminator
annotation #1683 (@daanboer)next
🔩 Dependency Updates
Authors: 12