diff --git a/checker/generator/checks.go b/checker/generator/checks.go index e098f5a8..4d8744dd 100644 --- a/checker/generator/checks.go +++ b/checker/generator/checks.go @@ -82,7 +82,8 @@ func getHierarchyMessage(hierarchy []string, atttibuted []bool) string { } func isTopLevel(s string) bool { - return s == "request body" || s == "paths" + return s == "request body" || + s == "paths" } func standardizeSpaces(s string) string { @@ -110,6 +111,8 @@ func conjugate(verb string) string { return "set" case "add": return "added" + case "become": + return "became" } return verb + "d" } diff --git a/checker/generator/data.go b/checker/generator/data.go index fefd4562..3505a8bb 100644 --- a/checker/generator/data.go +++ b/checker/generator/data.go @@ -7,6 +7,7 @@ func getAll() ValueSets { getPaths(), getRequest(), getResponse(), + getComponents(), ) } @@ -29,6 +30,33 @@ func getPaths() ValueSets { return NewValueSets(nil, nil, pathsValueSets) } +func getComponents() ValueSets { + return slices.Concat( + getSecurity(), + ) +} + +func getSecurity() ValueSets { + return NewValueSets(nil, nil, securityValueSets) +} + +var securityValueSets = ValueSets{ + ValueSetB{ + adjective: "%s", + adjectiveType: PREDICATIVE, + nouns: []string{"endpoint scheme security"}, + actions: []string{"add", "remove"}, + }, + ValueSetB{ + adjective: "%s", + adjectiveType: PREDICATIVE, + hierarchy: []string{"global security scheme"}, + attributed: []bool{false}, + nouns: []string{"security scope"}, + actions: []string{"add", "remove"}, + }, +} + var pathsValueSets = ValueSets{ ValueSetB{ adjective: "%s", @@ -36,6 +64,15 @@ var pathsValueSets = ValueSets{ nouns: []string{"success response status", "non-success response status"}, actions: []string{"add", "remove"}, }, + ValueSetB{ + adjective: "%s", + adjectiveType: PREDICATIVE, + hierarchy: []string{"endpoint security scheme"}, + attributed: []bool{false}, + nouns: []string{"security scope"}, + actions: []string{"add", "remove"}, + }, + // security scope %s was added to endpoint security scheme %s } var schemaValueSets = ValueSets{ @@ -57,6 +94,10 @@ var schemaValueSets = ValueSets{ nouns: []string{"pattern"}, actions: []string{"change"}, }, + ValueSetA{ + nouns: []string{"required property", "optional property"}, + actions: []string{"change"}, + }, ValueSetB{ adjective: "%s", adjectiveType: PREDICATIVE, diff --git a/checker/generator/messages.yaml b/checker/generator/messages.yaml index f7af70fa..d43c10a9 100644 --- a/checker/generator/messages.yaml +++ b/checker/generator/messages.yaml @@ -2,6 +2,8 @@ success-response-status-added: added success response status %s success-response-status-removed: removed success response status %s non-success-response-status-added: added non-success response status %s non-success-response-status-removed: removed non-success response status %s +endpoint-security-scheme-security-scope-added: added security scope %s to endpoint security scheme %s +endpoint-security-scheme-security-scope-removed: removed security scope %s from endpoint security scheme %s request-body-media-type-max-set: max value of media-type %s of request body was set to %s request-body-media-type-max-increased: max value of media-type %s of request body was increased from %s to %s request-body-media-type-max-decreased: max value of media-type %s of request body was decreased from %s to %s @@ -24,6 +26,8 @@ request-body-media-type-type-changed: type/format of media-type %s of request bo request-body-media-type-type-generalized: type/format of media-type %s of request body was generalized from %s to %s request-body-media-type-discriminator-property-name-changed: discriminator property name of media-type %s of request body was changed from %s to %s request-body-media-type-pattern-changed: pattern of media-type %s of request body was changed from %s to %s +request-body-media-type-required-property-changed: required property of media-type %s of request body was changed from %s to %s +request-body-media-type-optional-property-changed: optional property of media-type %s of request body was changed from %s to %s request-body-media-type-pattern-added: added pattern %s to media-type %s of request body request-body-media-type-pattern-removed: removed pattern %s from media-type %s of request body request-body-media-type-default-value-added: added default value to media-type %s of request body @@ -60,6 +64,8 @@ request-body-media-type-property-type-changed: type/format of property %s of med request-body-media-type-property-type-generalized: type/format of property %s of media-type %s of request body was generalized from %s to %s request-body-media-type-property-discriminator-property-name-changed: discriminator property name of property %s of media-type %s of request body was changed from %s to %s request-body-media-type-property-pattern-changed: pattern of property %s of media-type %s of request body was changed from %s to %s +request-body-media-type-property-required-property-changed: required property of property %s of media-type %s of request body was changed from %s to %s +request-body-media-type-property-optional-property-changed: optional property of property %s of media-type %s of request body was changed from %s to %s request-body-media-type-property-pattern-added: added pattern %s to property %s of media-type %s of request body request-body-media-type-property-pattern-removed: removed pattern %s from property %s of media-type %s of request body request-body-media-type-property-default-value-added: added default value to property %s of media-type %s of request body @@ -96,6 +102,8 @@ request-parameter-type-changed: type/format of %s request parameter %s was chang request-parameter-type-generalized: type/format of %s request parameter %s was generalized from %s to %s request-parameter-discriminator-property-name-changed: discriminator property name of %s request parameter %s was changed from %s to %s request-parameter-pattern-changed: pattern of %s request parameter %s was changed from %s to %s +request-parameter-required-property-changed: required property of %s request parameter %s was changed from %s to %s +request-parameter-optional-property-changed: optional property of %s request parameter %s was changed from %s to %s request-parameter-pattern-added: added pattern %s to %s request parameter %s request-parameter-pattern-removed: removed pattern %s from %s request parameter %s request-parameter-default-value-added: added default value to %s request parameter %s @@ -132,6 +140,8 @@ response-media-type-type-changed: type/format of media-type %s of response %s wa response-media-type-type-generalized: type/format of media-type %s of response %s was generalized from %s to %s response-media-type-discriminator-property-name-changed: discriminator property name of media-type %s of response %s was changed from %s to %s response-media-type-pattern-changed: pattern of media-type %s of response %s was changed from %s to %s +response-media-type-required-property-changed: required property of media-type %s of response %s was changed from %s to %s +response-media-type-optional-property-changed: optional property of media-type %s of response %s was changed from %s to %s response-media-type-pattern-added: added pattern %s to media-type %s of response %s response-media-type-pattern-removed: removed pattern %s from media-type %s of response %s response-media-type-default-value-added: added default value to media-type %s of response %s @@ -168,6 +178,8 @@ response-media-type-property-type-changed: type/format of property %s of media-t response-media-type-property-type-generalized: type/format of property %s of media-type %s of response %s was generalized from %s to %s response-media-type-property-discriminator-property-name-changed: discriminator property name of property %s of media-type %s of response %s was changed from %s to %s response-media-type-property-pattern-changed: pattern of property %s of media-type %s of response %s was changed from %s to %s +response-media-type-property-required-property-changed: required property of property %s of media-type %s of response %s was changed from %s to %s +response-media-type-property-optional-property-changed: optional property of property %s of media-type %s of response %s was changed from %s to %s response-media-type-property-pattern-added: added pattern %s to property %s of media-type %s of response %s response-media-type-property-pattern-removed: removed pattern %s from property %s of media-type %s of response %s response-media-type-property-default-value-added: added default value to property %s of media-type %s of response %s @@ -182,3 +194,7 @@ response-media-type-property-discriminator-added: added discriminator %s to prop response-media-type-property-discriminator-removed: removed discriminator %s from property %s of media-type %s of response %s response-media-type-property-mapping-keys-added: added mapping keys %s to property %s of media-type %s of response %s response-media-type-property-mapping-keys-removed: removed mapping keys %s from property %s of media-type %s of response %s +endpoint-scheme-security-added: added endpoint scheme security %s +endpoint-scheme-security-removed: removed endpoint scheme security %s +global-security-scheme-security-scope-added: added security scope %s to global security scheme %s +global-security-scheme-security-scope-removed: removed security scope %s from global security scheme %s