mikekonan / go-oas3

Open API v3 server code generator
MIT License
20 stars 8 forks source link

Provide access to gen.ErrorResponseBody via hook #12

Closed valichek closed 3 years ago

valichek commented 3 years ago

There must be easy way to access data from handler (like error) in hook. It can be ResponseBodyWriteCompleted hook with signature func(request *http.Request, handlerName string, bytesWritten int, statusCode int, body interface{}) Maybe it would be more general also to pass context from handler to the hook.

builder.StatusCode400().ApplicationJson().Body(responseBody).Build(ctx)