feat: 数据响应使用ref引用方式
This commit is contained in:
@@ -247,23 +247,12 @@ func (g *Generate) AddApiDoc(docFlag string, apiMeta define.UriConfig, request a
|
|||||||
Origin: nil,
|
Origin: nil,
|
||||||
Ref: "",
|
Ref: "",
|
||||||
Value: &openapi3.Response{
|
Value: &openapi3.Response{
|
||||||
Extensions: nil,
|
|
||||||
Origin: nil,
|
|
||||||
Description: &desc,
|
Description: &desc,
|
||||||
Headers: nil,
|
|
||||||
Content: map[string]*openapi3.MediaType{
|
Content: map[string]*openapi3.MediaType{
|
||||||
consts.MimeTypeJson: {
|
consts.MimeTypeJson: {
|
||||||
Extensions: nil,
|
|
||||||
Origin: nil,
|
|
||||||
Schema: &openapi3.SchemaRef{
|
Schema: &openapi3.SchemaRef{
|
||||||
Extensions: nil,
|
Ref: "#/components/schemas/" + strings.TrimLeft(responseTypeStr, "*"),
|
||||||
Origin: nil,
|
|
||||||
Ref: "#/components/schemas/" + strings.TrimLeft(responseTypeStr, "*"),
|
|
||||||
Value: nil,
|
|
||||||
},
|
},
|
||||||
Example: nil,
|
|
||||||
Examples: nil,
|
|
||||||
Encoding: nil,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Links: nil,
|
Links: nil,
|
||||||
|
|||||||
Reference in New Issue
Block a user