Custom success and error content-types in chi wrapper mode #115
Answered
by
vearutop
pboguslawski
asked this question in
Q&A
-
Is it currently possible to define custom content-type header value for success and error responses in place of default
Something similar to https://github.com/swaggest/rest/blob/v0.2.25/_examples/advanced/router.go#L98 avaliable "in |
Beta Was this translation helpful? Give feedback.
Answered by
vearutop
Jan 19, 2023
Replies: 1 comment
-
It is possible to do for // Router mode.
r := chirouter.NewWrapper(chi.NewRouter())
r.Method(http.MethodPost, "/foo", nethttp.SuccessfulResponseContentType(fooUsecase(),"foo/bar")))
// Same with web.Service.
s := web.DefaultService()
s.Post("/foo", fooUsecase(), nethttp.SuccessfulResponseContentType("foo/bar")) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
pboguslawski
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is possible to do for
SuccessfulResponseContentType
, but there is no control yet for error content type.