Skip to content

Commit

Permalink
Order tolerates a 0 value, so remove required tag
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Lucidi <[email protected]>
  • Loading branch information
mansam committed Jun 28, 2024
1 parent f022bb3 commit e5ec915
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions migration/v14/model/assessment.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,21 @@ type Review struct {
Archetype *Archetype
}

//
// JSON Fields.
//

// Section represents a group of questions in a questionnaire.
type Section struct {
Order uint `json:"order" yaml:"order" binding:"required"`
Order uint `json:"order" yaml:"order"`
Name string `json:"name" yaml:"name"`
Questions []Question `json:"questions" yaml:"questions" binding:"min=1,dive"`
Comment string `json:"comment,omitempty" yaml:"comment,omitempty"`
}

// Question represents a question in a questionnaire.
type Question struct {
Order uint `json:"order" yaml:"order" binding:"required"`
Order uint `json:"order" yaml:"order"`
Text string `json:"text" yaml:"text"`
Explanation string `json:"explanation" yaml:"explanation"`
IncludeFor []CategorizedTag `json:"includeFor,omitempty" yaml:"includeFor,omitempty"`
Expand All @@ -65,7 +69,7 @@ type Question struct {

// Answer represents an answer to a question in a questionnaire.
type Answer struct {
Order uint `json:"order" yaml:"order" binding:"required"`
Order uint `json:"order" yaml:"order"`
Text string `json:"text" yaml:"text"`
Risk string `json:"risk" yaml:"risk" binding:"oneof=red yellow green unknown"`
Rationale string `json:"rationale" yaml:"rationale"`
Expand Down

0 comments on commit e5ec915

Please sign in to comment.