-
Notifications
You must be signed in to change notification settings - Fork 205
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: support for generic functions #2159
Conversation
Probably continuation of #1978 |
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.
Tests are failing but overall looks reasonable.
Hey @domoritz, sorry for the delay, should be working now. Instead of crashing with ts-json-schema-generator/src/ChainNodeParser.ts Lines 46 to 48 in 6f776af
Where this incapacity is expected, we should be adding a If somehow a {
type: "object",
properties: {
fieldThatFailed: { description: "Failed to correctly generate type" },
},
} So we still give a hint for this unexpected unknown in the final schema. |
@@ -93,6 +93,7 @@ | |||
"vega": "^5.30.0", | |||
"vega-lite": "^5.21.0" | |||
}, | |||
"packageManager": "[email protected]", |
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.
Why is this needed?
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.
corepack is a good standard when working with a lot of different package managers on a lot of different projects.
This field is the standard field that a lot of tools (including corepack) will use to determine the package manager.
I can remove it if you want
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.
I just don't feel like we specifically need that version of npm. Yeah, let's remove it since we don't consistently use it in this org.
Co-authored-by: Dominik Moritz <[email protected]>
@domoritz can I merge? |
Yes, go ahead. |
tks |
🚀 PR was released in |
Previously, functions like:
would throw even when not in use because it would parse the function without a reference to each parameter on their respective call, since
A
is generic but in the case offn(1)
,A
isnumber
.I added some extra security checks to avoid
undefined
errors being thrown without extra information about the actual node.📦 Published PR as canary version:
2.3.1--canary.2159.32f3c45.0
✨ Test out this PR locally via:
Version
Published prerelease version:
v2.4.0-next.7
Changelog
🎉 This release contains work from new contributors! 🎉
Thanks for all your work!
❤️ Michael Matloka (@Twixes)
❤️ null@dcharbonnier
❤️ Werner Robitza (@slhck)
❤️ Bence Balogh (@baloghbence0915)
🚀 Enhancement
--expose all
with generic types #2009 (@arthurfiorette)🐛 Bug Fix
next
🔩 Dependency Updates
Authors: 7