-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
discussWe need discuss to make decision.We need discuss to make decision.enhancementhelp wantedplannedThis issue/proposal is planned into our next steps.This issue/proposal is planned into our next steps.
Description
Go version
go1.22
GoFrame version
2.7.0
Can this bug be reproduced with the latest release?
Option Yes
What did you do?
req.Server.GetOpenApi().Add(goai.AddInput{
Object: req.Server.GetOpenApi().Config.CommonResponse,
})
req.Server.GetOpenApi().Components.Responses = goai.Responses{
"InternalServerError": goai.ResponseRef{
Value: &goai.Response{
Description: "InternalServerError",
Content: map[string]goai.MediaType{
"application/json": {Schema: &goai.SchemaRef{Ref: "model.DefaultHandlerResponse"}},
},
},
},
}
I want to customize the response 500 content,
output
"500": {
"$ref": "#/components/schemas/InternalServerError"
}
He should be "#/components/responses/InternalServerError", see https://swagger.io/docs/specification/describing-responses/
What did you see happen?
It is not possible to customize the reference response structure in OpenAI because its prefix is always fixed
code is:
Line 227 in 6e5ce98
return []byte(fmt.Sprintf(`{"$ref":"#/components/schemas/%s"}`, ref)) |
What did you expect to see?
He should be "#/components/responses/InternalServerError", see https://swagger.io/docs/specification/describing-responses/
shuqingzaishuqingzai
Metadata
Metadata
Assignees
Labels
discussWe need discuss to make decision.We need discuss to make decision.enhancementhelp wantedplannedThis issue/proposal is planned into our next steps.This issue/proposal is planned into our next steps.