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
any type (generics) #2809
Comments
For what use case? example? |
If, for example, we can get a variety of data from a response, a wrapper that can wrap all such data would be useful. This can replace Example: // swagger:model transportErr
type transportErr struct {
// Message is a human-readable description of the error.
// Required: true
Message string `json:"message"`
// Data is additional data about the error.
Data any `json:"data,omitempty"` // <- for this use case. Unsupported type "invalid type"
} |
I thought |
I think what is being asked is to support |
The v0.29.0 generator does not understand If we try to use fields of type
because it sees I think this is what @casualjim is asking. @youyuanwu is there a plan to support it ? |
whereas if we just change the type of parameter from |
Also would like to know if there are plans to include this in the future? |
I added some tests for where we have the type I think you may get it to work with previous versions of go swagger by building from source with a newer golang like go 1.18. |
run go 1.19 gofmt on the codebase reduce use of deprecated constructs update to yaml.v3 where appropriate start building on github actions add tests for `any` type add type from issue #2809
run go 1.19 gofmt on the codebase reduce use of deprecated constructs update to yaml.v3 where appropriate start building on github actions add tests for `any` type add type from issue go-swagger#2809
Does swagger will support
any
type from generics?The text was updated successfully, but these errors were encountered: