Skip to content

Commit

Permalink
required/optional request-body
Browse files Browse the repository at this point in the history
  • Loading branch information
reuvenharrison committed Aug 31, 2024
1 parent c97b1c3 commit 1d3733d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions checker/generator/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func generateId(hierarchy []string, noun, action string) string {
}

func concat(list []string) string {
if list == nil {
if len(list) == 0 {
return ""
}

Expand All @@ -53,7 +53,7 @@ func concat(list []string) string {
}

func getHierarchyPostfix(action string, hierarchy []string, atttibuted []bool) string {
if hierarchy == nil {
if len(hierarchy) == 0 {
return ""
}

Expand Down
9 changes: 8 additions & 1 deletion checker/generator/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func getRequest() ValueSets {
NewValueSets([]string{"media-type", "request body"}, nil, schemaValueSets),
NewValueSets([]string{"property", "media-type", "request body"}, nil, schemaValueSets),
NewValueSets([]string{"request parameter"}, []bool{true}, schemaValueSets),
NewValueSets(nil, nil, operationValueSets),
)
}

Expand Down Expand Up @@ -72,7 +73,13 @@ var pathsValueSets = ValueSets{
nouns: []string{"security scope"},
actions: []string{"add", "remove"},
},
// security scope %s was added to endpoint security scheme %s
}

var operationValueSets = ValueSets{
ValueSetB{
nouns: []string{"required request body", "optional request body"},
actions: []string{"add", "remove"},
},
}

var schemaValueSets = ValueSets{
Expand Down
4 changes: 4 additions & 0 deletions checker/generator/messages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ request-parameter-discriminator-added: added discriminator %s to %s request para
request-parameter-discriminator-removed: removed discriminator %s from %s request parameter %s
request-parameter-mapping-keys-added: added mapping keys %s to %s request parameter %s
request-parameter-mapping-keys-removed: removed mapping keys %s from %s request parameter %s
required-request-body-added: added required request body
required-request-body-removed: removed required request body
optional-request-body-added: added optional request body
optional-request-body-removed: removed optional request body
response-media-type-max-set: max value of media-type %s of response %s was set to %s
response-media-type-max-increased: max value of media-type %s of response %s was increased from %s to %s
response-media-type-max-decreased: max value of media-type %s of response %s was decreased from %s to %s
Expand Down

0 comments on commit 1d3733d

Please sign in to comment.