Skip to content

Commit

Permalink
Fix retro settings request body validation
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenWeathers committed Oct 16, 2024
1 parent 23179d7 commit 8e1f9a0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions docs/swagger/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -12425,7 +12425,8 @@ const docTemplate = `{
"type": "string",
"enum": [
"visible",
"hidden"
"hidden",
"concealed"
]
},
"facilitatorCode": {
Expand All @@ -12444,7 +12445,7 @@ const docTemplate = `{
},
"phaseTimeLimit": {
"type": "integer",
"maximum": 120,
"maximum": 59,
"minimum": 0
},
"templateId": {
Expand Down
5 changes: 3 additions & 2 deletions docs/swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -12417,7 +12417,8 @@
"type": "string",
"enum": [
"visible",
"hidden"
"hidden",
"concealed"
]
},
"facilitatorCode": {
Expand All @@ -12436,7 +12437,7 @@
},
"phaseTimeLimit": {
"type": "integer",
"maximum": 120,
"maximum": 59,
"minimum": 0
},
"templateId": {
Expand Down
3 changes: 2 additions & 1 deletion docs/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ definitions:
enum:
- visible
- hidden
- concealed
type: string
facilitatorCode:
type: string
Expand All @@ -440,7 +441,7 @@ definitions:
phaseAutoAdvance:
type: boolean
phaseTimeLimit:
maximum: 120
maximum: 59
minimum: 0
type: integer
templateId:
Expand Down
4 changes: 2 additions & 2 deletions internal/http/retrosettings.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
type retroSettingsRequestBody struct {
MaxVotes int16 `json:"maxVotes" validate:"gte=1,lte=100"`
AllowMultipleVotes bool `json:"allowMultipleVotes"`
BrainstormVisibility string `json:"brainstormVisibility" validate:"oneof=visible hidden"`
PhaseTimeLimit int16 `json:"phaseTimeLimit" validate:"gte=0,lte=120"`
BrainstormVisibility string `json:"brainstormVisibility" validate:"oneof=visible hidden concealed"`
PhaseTimeLimit int16 `json:"phaseTimeLimit" validate:"gte=0,lte=59"`
PhaseAutoAdvance bool `json:"phaseAutoAdvance"`
AllowCumulativeVoting bool `json:"allowCumulativeVoting"`
TemplateID *string `json:"templateId" validate:"omitempty,uuid"`
Expand Down

0 comments on commit 8e1f9a0

Please sign in to comment.