You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 Validate(formats strfmt.Registry) error (instead of interface-checking at runtime), while [protoc-gen-validate](https://github.com/bufbuild/protoc-gen-validate) provides Validate() error
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
🚀 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: