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
I'm running into some odd behavior (at least in relation to what I'm interpreting from the documentation).
I have the following structure and annotation using it for my handler.
type serviceMetrics struct {
Id string `json:"Id"`
ResponseTime []map[string]string `json:"ResponseTime"`
StatusInfo []map[string]string `json:"StatusInfo"`
AvailabilityInfo []map[string]string `json:"AvailabilityInfo"`
ThroughputInfo []map[string]string `json:"ThroughputInfo"`
}
@Success 200 {object} serviceMetrics
The struct is in the same .go file as the handler for which I have the @Success annotation.
I added the json definition to try to fix the problem but it didn't seem to do anything and I still get the following error when running swagger with or without the definitions.
Can not find definition of []string model. Current package packagename
There is no array of strings present in the struct. What I actually return from the handler is a map[string]serviecMetrics but writing it like that doesn't seem to work since it doesn't recognize map.
The text was updated successfully, but these errors were encountered:
dhudici
changed the title
How @Success annotation gets parsed
How @Success annotation get parsed
Oct 29, 2015
dhudici
changed the title
How @Success annotation get parsed
How @Success annotation gets parsed
Oct 29, 2015
I'm running into some odd behavior (at least in relation to what I'm interpreting from the documentation).
I have the following structure and annotation using it for my handler.
The struct is in the same
.go
file as the handler for which I have the@Success
annotation.I added the
json
definition to try to fix the problem but it didn't seem to do anything and I still get the following error when running swagger with or without the definitions.Can not find definition of []string model. Current package packagename
There is no array of strings present in the struct. What I actually return from the handler is a
map[string]serviecMetrics
but writing it like that doesn't seem to work since it doesn't recognizemap
.The text was updated successfully, but these errors were encountered: