Skip to content

Commit 472de0a

Browse files
committed
Fix operation "description" must be present and non-empty string.
1 parent 9ce5aaf commit 472de0a

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

build.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ func makeAllPathsMap(paths *Paths) pathsMap {
137137
pathMap[keyTags] = path.Tags
138138
pathMap[keySummary] = path.Summary
139139
pathMap[keyOperationID] = path.OperationID
140+
pathMap[keyDescription] = path.Description
140141
pathMap[keySecurity] = makeSecurityMap(&path.Security)
141142
pathMap[keyRequestBody] = makeRequestBodyMap(&path.RequestBody)
142143
pathMap[keyResponses] = makeResponsesMap(&path.Responses)

examples/api-documentation.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import "github.com/go-oas/docs"
55
func handleCreateUserRoute(oasPathIndex int, oas *docs.OAS) {
66
path := oas.GetPathByIndex(oasPathIndex)
77

8-
path.Summary = "Create a new User"
8+
path.Description = "Create a new User"
99
path.OperationID = "createUser"
1010

1111
path.RequestBody = docs.RequestBody{
@@ -34,7 +34,7 @@ func handleCreateUserRoute(oasPathIndex int, oas *docs.OAS) {
3434
func handleGetUserRoute(oasPathIndex int, oas *docs.OAS) {
3535
path := oas.GetPathByIndex(oasPathIndex)
3636

37-
path.Summary = "Get a User"
37+
path.Description = "Get a User"
3838
path.OperationID = "getUser"
3939
path.RequestBody = docs.RequestBody{}
4040
path.Responses = docs.Responses{

models.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ type Path struct {
9898
HTTPMethod string `yaml:"httpMethod"`
9999
Tags []string `yaml:"tags"`
100100
Summary string `yaml:"summary"`
101+
Description string `yaml:"description"`
101102
OperationID string `yaml:"operationId"`
102103
RequestBody RequestBody `yaml:"requestBody"`
103104
Responses Responses `yaml:"responses"`

0 commit comments

Comments
 (0)