fix(swagger): expand inline pointer members (#5664)

Co-authored-by: kevin <wanjunfeng@gmail.com>
This commit is contained in:
lxffong
2026-07-20 00:20:41 +08:00
committed by GitHub
parent 565bcb3f21
commit 394ffcc19a
3 changed files with 84 additions and 3 deletions

View File

@@ -103,6 +103,27 @@ type (
Language string `json:"language"`
Gender string `json:"gender"`
}
EmbeddedUser {
UserId int `json:"userId,example=10"`
Username string `json:"username,example=keson.an"`
}
EmbeddedAudit {
TraceId string `json:"traceId,example=trace-001"`
CreatedBy string `json:"createdBy,optional,example=system"`
}
EmbeddedProfile {
EmbeddedUser
*EmbeddedAudit
Nickname string `json:"nickname,optional,example=keson"`
}
EmbeddedJsonReq {
EmbeddedProfile
RequestId string `json:"requestId,example=req-001"`
}
EmbeddedJsonResp {
EmbeddedProfile
Success bool `json:"success,example=true"`
}
ComplexJsonLevel2 {
// basic
Integer int `json:"integer,example=1"`
@@ -238,4 +259,10 @@ service Swagger {
)
@handler jsonComplex
post /json/complex (ComplexJsonReq) returns (ComplexJsonResp)
@doc (
description: "embedded json request body API"
)
@handler jsonEmbedded
post /json/embedded (EmbeddedJsonReq) returns (EmbeddedJsonResp)
}