Skip to content

Commit

Permalink
Adds documentation for openapi operations
Browse files Browse the repository at this point in the history
  • Loading branch information
EwenQuim committed Feb 22, 2024
1 parent aaca401 commit 805d9d3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions openapi_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func (r Route[ResponseBody, RequestBody]) Summary(summary string) Route[Response
return r
}

// Overrides the operationID for the route.
func (r Route[ResponseBody, RequestBody]) OperationID(operationID string) Route[ResponseBody, RequestBody] {
r.operation.OperationID = operationID
return r
Expand Down Expand Up @@ -68,16 +69,20 @@ func (r Route[ResponseBody, RequestBody]) QueryParam(name, description string, p
return r
}

// Replace the tags for the route.
// By default, the tag is the type of the response body.
func (r Route[ResponseBody, RequestBody]) Tags(tags ...string) Route[ResponseBody, RequestBody] {
r.operation.Tags = tags
return r
}

// AddTags adds tags to the route.
func (r Route[ResponseBody, RequestBody]) AddTags(tags ...string) Route[ResponseBody, RequestBody] {
r.operation.Tags = append(r.operation.Tags, tags...)
return r
}

// RemoveTags removes tags from the route.
func (r Route[ResponseBody, RequestBody]) RemoveTags(tags ...string) Route[ResponseBody, RequestBody] {
for _, tag := range tags {
for i, t := range r.operation.Tags {
Expand Down

0 comments on commit 805d9d3

Please sign in to comment.