-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Automatically annotate using x-go-type #4927
Comments
Hi Norman, thanks for your issue! I don't remember this having been requested before. I think it could make sense as a feature to save users having to supply these annotations themselves everywhere, but it should be behind a generator option, so it doesn't add annotations to users that don't want it. Would you be interested in helping implement this? |
A generator option would be everything or nothing, though... Oh well I guess it would be enough But the problem I will hit while doing so is that go-swagger expects the type to implement Ah that's a bit annoying. Not directly related to this issue though. I'll see if I can get go-swagger to assert on the interface instead |
Hi @johanbrandhorst , I’d like to contribute to implementing support for
Additionally, is this feature currently implemented, or does it still need to be worked on? If it's available for contribution, I’d love to help implement it. Looking forward to your guidance! Thanks! |
Hi Rohit, it's great to hear that you'd like to work on implementing this feature. To answer your questions:
Some more information for you: It seems like the Let me know if you need anymore information! |
Thanks @johanbrandhorst for the detailed clarification! Let me summarize my understanding before proceeding:
|
@johanbrandhorst can you check this PR #5340 |
🚀 Feature
In a way I'm a bit surprised this hasn't been done / hasn't been requested.
Given the content of the proto file, it would be quite easy to generate the
x-go-type
annotation automatically for the OpenAPIv2 spec file, such that go-swagger can re-use the go type and not regenerate a new one. We use a monorepo, so for us this is super powerful.I've managed to get it going using
So I guess I'm curious as to whether this was considered / rejected, and if PRs would be welcome here.
We wouldn't want to pollute JsonSchema of course, so I'd suggest this could go through another annotation.
The text was updated successfully, but these errors were encountered: