Open nonlinearthink opened 6 days ago
Middleware would not change the final doc. If you want to add a "common response", you can add one in the openapi config
openapi.Config.CommonResponse = api.CommonRes{}
or change response structure one by one in your Standardized Routing
.
@UncleChair Thank you, I have resolved this problem through:
openapi := s.GetOpenApi()
openapi.Config.CommonResponse = ghttp.DefaultHandlerResponse{}
openapi.Config.CommonResponseDataField = "Data"
What do you want to ask?
I am using
ghttp.MiddlewareHandlerResponse
, but the output swagger document does not include the 'code', 'message', and 'data' fields, and I used theswagger-generator
to generate the client's code, which strongly depends on the swagger document.