MCPcopy Create free account
hub / github.com/a-h/rest / HasResponseModel

Method HasResponseModel

api.go:262–265  ·  view source on GitHub ↗

HasResponseModel configures a response for the route. Example: api.Get("/user").HasResponseModel(http.StatusOK, rest.ModelOf[User]())

(status int, response Model)

Source from the content-addressed store, hash-verified

260//
261// api.Get("/user").HasResponseModel(http.StatusOK, rest.ModelOf[User]())
262func (rm *Route) HasResponseModel(status int, response Model) *Route {
263 rm.Models.Responses[status] = response
264 return rm
265}
266
267// HasResponseModel configures the request model of the route.
268// Example:

Callers 4

TestSchemaFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestSchemaFunction · 0.64