Given a struct created with generics the swagger doc compiles correctly but will fail to reference the definition correctly.
Example:
type Response[T any] struct{
MetaData MetaData `json:"meta"`
Objects []T `json:"objects"
}
type MyObject struct{
Foo string `json:"foo"`
Bar int `json:"bar"`
}
Passing in a variable of type module.Response[module.MyObject]{} will yield a definition for module.Response[module.MyObject] as well as module.MyObject. But the reference to this definition will use the key #/definitions/module.Response%5Bmodule.MyObject%5D.
The proposed change would be to sanitize the definition keys to be [->%5B and ] ->%5D
Given a struct created with generics the swagger doc compiles correctly but will fail to reference the definition correctly.
Example:
Passing in a variable of type
module.Response[module.MyObject]{}will yield a definition formodule.Response[module.MyObject]as well asmodule.MyObject. But the reference to this definition will use the key#/definitions/module.Response%5Bmodule.MyObject%5D.The proposed change would be to sanitize the definition keys to be
[->%5Band]->%5D