Closed opvexe closed 2 years ago
You need to describe what the response would look like.
Try @success 200 {object} errors.Error
You need to describe what the response would look like.
Try
@success 200 {object} errors.Error
_ "yho.io/wsm/errors"
Doing this will compile the past.
Err error `json:"-"`
You need to describe what the response would look like.
Try
@success 200 {object} errors.Error
There seems to be a problem with introducing an external third party?
± swag init --parseDependency --parseInternal
2022/08/17 17:58:52 Generate swagger docs....
2022/08/17 17:58:52 Generate general API Info, search dir:./
2022/08/17 17:58:52 Generating errors.Error
2022/08/17 17:58:52 ParseComment error in file /Users/taoshumin_vendor/go/src/test.io/wsm/server/http_server_mesh.go :missing required param comment parameters "data body v1alpha3.Gateway"
Try to alias the import.
alias
alias don't seem to work.
Try to alias the import.
swag init --parseDependency -g main.go
this way can solve .
Try to alias the import.
May I ask you another question? How to write struct generics? Why do I write an error like this?
type SortConstraint interface {
*v1alpha3.Gateway | *v1alpha3.DestinationRule | *v1alpha3.VirtualService
}
type oldestFirst[T SortConstraint] []*T
func (q oldestFirst[T]) Len() int { return len(q) }
func (q oldestFirst) Less(a, b int) bool {
return q[a].CreationTimestamp.Time.After(q[b].CreationTimestamp.Time)
}
func (q oldestFirst) Swap(a, b int) { q[a], q[b] = q[b], q[a] }
The generics support is in the early stage of development. Not sure if it's possible. Anyway, you need to describe a response object and you can better use a DTO for that.