-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: support custom codec files in host repositories #870
Conversation
this.knownImports[packageName] = { | ||
...this.knownImports[packageName], | ||
...customCodecs, | ||
}; |
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.
question for reviewers: do you think the order should be switched around here? i.e. ...customCodecs
comes first, so that if a downstream repo wants to redefine a schema for whatever reason, they can still do that rather than having it overwritten by the main schema definition
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.
went ahead and made the change, let me know if you think it should be reverted. I think it makes sense to give the end user more priority.
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 agree with this approach 👍🏽
Co-authored-by: Ansh Chaturvedi <[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.
🚀
🎉 This PR is included in version @api-ts/[email protected] 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @api-ts/[email protected] 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @api-ts/[email protected] 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @api-ts/[email protected] 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @api-ts/[email protected] 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
DX-658
This ticket adds support for types packages to define schemas for their own custom codecs (that are defined with
t.Type
or other un-supported primitives).To make use of this feature in the types package, first create a file titled
openapi-gen.config.js
. Then, add the following to the package.json in the package"customCodecFile": "openapi-gen.config.js"
. Then, you can populate the file with your schemas like this: