Skip to content

Commit

Permalink
swagger added. Response output renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Golev committed Mar 5, 2020
1 parent 2c5019f commit 5235495
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dkron/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func (h *HTTPTransport) isLeaderHandler(c *gin.Context) {
if isleader {
renderJSON(c, http.StatusOK, "I am a leader")
} else {
renderJSON(c, http.StatusNotFound, "I am not a leader")
renderJSON(c, http.StatusNotFound, "I am a follower")
}
}

Expand Down
12 changes: 12 additions & 0 deletions website/content/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,18 @@ paths:
description: Successful response
schema:
$ref: '#/definitions/member'
/isleader:
get:
description: |
Check if node is a leader or follower.
operationId: getIsLeader
tags:
- default
responses:
200:
description: Node is a leader
404:
description: Node is a follower
/leave:
post:
description: |
Expand Down
12 changes: 12 additions & 0 deletions website/content/v1.2/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,18 @@ paths:
description: Successful response
schema:
$ref: '#/definitions/member'
/isleader:
get:
description: |
Check if node is a leader or follower.
operationId: getIsLeader
tags:
- default
responses:
200:
description: Node is a leader
404:
description: Node is a follower
/leave:
get:
description: |
Expand Down

0 comments on commit 5235495

Please sign in to comment.