-
Notifications
You must be signed in to change notification settings - Fork 79
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
Support generics in generated types #171
Comments
I think maybe we could start defining JSON Schemas in https://github.com/octokit/webhooks, besides the examples? We could still use the examples to validate against the schema, but use the schema to generate the types for There is an interest in JSON Schemas for webhooks from both users and GitHub, see github/rest-api-description#21. We could accelerate that process with a community run effort in What do you think? |
Using JSON Schemas does seem reasonable to me. However I just looked through the "Webhook events and payloads" and it looks like that descriptions there are too inconsistent for us to be able to parse them. I guess we could start by composing the schema manually. |
Yes, that's what I would suggest. We can bootstrap them the examples in the repository, see https://github.com/octokit/webhooks/tree/master/payload-examples/api.github.com. Unfortunately Shall we take this discussion over to the octokit/webhooks repository? |
closing in favor of octokit/webhooks#136 |
Hey guys 🙂
First off, thanks for the awesome project! After #168 got merged I started using generated types for
workflow_dispatch
event and it works great. However having to type castinputs
of the event throughany
pains me a lot:However, I do believe that a better developer experience can be achieved by introducing generics in generated types:
It is something that should be raised here or in gimenete/type-writer? I'd be happy to move this issue there if that's the case. Anyway, I would be happy to assist with a PR if/when we figure out some kind of a solution for this.
The text was updated successfully, but these errors were encountered: