feat(swagger): add Chinese summaries and descriptions for routes
Replace generic "METHOD path" summaries with curated Chinese summaries and longer descriptions, surfaced in Swagger UI. Adds a parity test that fails when a new tenant-api route is wired up without a docs entry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -72,12 +72,16 @@ func BuildOpenAPI(routes gin.RoutesInfo, cfg Config) map[string]any {
|
||||
tagSet[tag] = struct{}{}
|
||||
|
||||
operationID := uniqueOperationID(method+"_"+sanitizeIdentifier(path), operationIDs)
|
||||
doc := docFor(route.Method, route.Path)
|
||||
operation := map[string]any{
|
||||
"tags": []string{tag},
|
||||
"summary": route.Method + " " + path,
|
||||
"summary": doc.Summary,
|
||||
"operationId": operationID,
|
||||
"responses": responsesForRoute(route),
|
||||
}
|
||||
if doc.Description != "" {
|
||||
operation["description"] = doc.Description
|
||||
}
|
||||
|
||||
if params := parametersForRoute(route); len(params) > 0 {
|
||||
operation["parameters"] = params
|
||||
|
||||
Reference in New Issue
Block a user