diff --git a/BREAKING-CHANGES-EXAMPLES.md b/BREAKING-CHANGES-EXAMPLES.md index 7ce6b8d7..4801f3b2 100644 --- a/BREAKING-CHANGES-EXAMPLES.md +++ b/BREAKING-CHANGES-EXAMPLES.md @@ -1,11 +1,11 @@ # Examples of Breaking and Non-Breaking Changes These examples are automatically generated from unit tests. ## Examples of breaking changes -[adding 'allOf' subschema to the request body or request body property is breaking](checker/checker_breaking_test.go?plain=1#L693) +[adding 'allOf' subschema to the request body or request body property is breaking](checker/checker_breaking_test.go?plain=1#L718) [adding a new required property in request body is breaking](checker/checker_breaking_property_test.go?plain=1#L352) -[adding a pattern to a schema is breaking for recursive properties](checker/checker_breaking_test.go?plain=1#L474) -[adding a pattern to a schema is breaking](checker/checker_breaking_test.go?plain=1#L458) -[adding a required request body is breaking](checker/checker_breaking_test.go?plain=1#L65) +[adding a pattern to a schema is breaking for recursive properties](checker/checker_breaking_test.go?plain=1#L496) +[adding a pattern to a schema is breaking](checker/checker_breaking_test.go?plain=1#L479) +[adding a required request body is breaking](checker/checker_breaking_test.go?plain=1#L67) [changing a request body to enum is breaking](checker/checker_breaking_property_test.go?plain=1#L122) [changing a request body type and changing it to enum simultaneously is breaking](checker/checker_breaking_property_test.go?plain=1#L152) [changing a request property to not nullable is breaking](checker/checker_breaking_property_test.go?plain=1#L232) @@ -14,7 +14,7 @@ These examples are automatically generated from unit tests. [changing a response property to nullable is breaking](checker/checker_breaking_property_test.go?plain=1#L248) [changing a response property to optional under AllOf, AnyOf or OneOf is breaking](checker/checker_breaking_property_test.go?plain=1#L643) [changing an embedded response property to nullable is breaking](checker/checker_breaking_property_test.go?plain=1#L264) -[changing an existing header param from optional to required is breaking](checker/checker_breaking_test.go?plain=1#L187) +[changing an existing header param from optional to required is breaking](checker/checker_breaking_test.go?plain=1#L196) [changing an existing header param to enum is breaking](checker/checker_breaking_property_test.go?plain=1#L184) [changing an existing property in request body anyOf to required is breaking](checker/checker_breaking_property_test.go?plain=1#L611) [changing an existing property in request body items to required is breaking](checker/checker_breaking_property_test.go?plain=1#L595) @@ -24,9 +24,9 @@ These examples are automatically generated from unit tests. [changing an existing property in request header to required is breaking](checker/checker_breaking_property_test.go?plain=1#L56) [changing an existing property in response body to optional is breaking](checker/checker_breaking_property_test.go?plain=1#L106) [changing an existing property under another property in request body to required is breaking](checker/checker_breaking_property_test.go?plain=1#L627) -[changing an existing request body from optional to required is breaking](checker/checker_breaking_test.go?plain=1#L82) +[changing an existing request body from optional to required is breaking](checker/checker_breaking_test.go?plain=1#L85) [changing an existing required property in response body to not-write-only is breaking](checker/checker_breaking_property_test.go?plain=1#L560) -[changing an existing response header from required to optional is breaking](checker/checker_breaking_test.go?plain=1#L210) +[changing an existing response header from required to optional is breaking](checker/checker_breaking_test.go?plain=1#L220) [changing max length in request from nil to any value is breaking](checker/checker_breaking_min_max_test.go?plain=1#L110) [changing max length in response from any value to nil is breaking](checker/checker_breaking_min_max_test.go?plain=1#L160) [changing request's body schema type from number to integer is breaking](checker/checker_breaking_request_type_changed_test.go?plain=1#L51) @@ -37,7 +37,7 @@ These examples are automatically generated from unit tests. [changing response's body schema type from number to string is breaking](checker/checker_breaking_response_type_changed_test.go?plain=1#L31) [changing response's body schema type from string to number is breaking](checker/checker_breaking_response_type_changed_test.go?plain=1#L11) [changing response's embedded property schema type from string/none to integer/int32 is breaking](checker/checker_breaking_response_type_changed_test.go?plain=1#L108) -[deleting a media-type from response is breaking](checker/checker_breaking_test.go?plain=1#L428) +[deleting a media-type from response is breaking](checker/checker_breaking_test.go?plain=1#L448) [deleting a non-required non-write-only property in response body is breaking with warning](checker/checker_breaking_property_test.go?plain=1#L511) [deleting a path is breaking](checker/checker_breaking_test.go?plain=1#L43) [deleting a path with some operations having sunset date in the future is breaking](checker/checker_deprecation_test.go?plain=1#L271) @@ -45,44 +45,44 @@ These examples are automatically generated from unit tests. [deleting a required property in response body is breaking](checker/checker_breaking_property_test.go?plain=1#L420) [deleting a required property under AllOf in response body is breaking](checker/checker_breaking_property_test.go?plain=1#L450) [deleting an embedded optional property in request is breaking with warn](checker/checker_breaking_property_test.go?plain=1#L385) -[deleting an enum value is breaking](checker/checker_breaking_test.go?plain=1#L103) +[deleting an enum value is breaking](checker/checker_breaking_test.go?plain=1#L107) [deleting an operation before sunset date is breaking](checker/checker_deprecation_test.go?plain=1#L33) -[deleting an operation is breaking](checker/checker_breaking_test.go?plain=1#L50) +[deleting an operation is breaking](checker/checker_breaking_test.go?plain=1#L51) [deleting an operation without sunset date is breaking](checker/checker_deprecation_test.go?plain=1#L50) [deleting sunset header for a deprecated endpoint is breaking](checker/checker_deprecation_test.go?plain=1#L288) [deprecating an operation with a deprecation policy and sunset date before required deprecation period is breaking](checker/checker_deprecation_test.go?plain=1#L216) [deprecating an operation with a deprecation policy but without specifying sunset date is breaking](checker/checker_deprecation_test.go?plain=1#L82) [increasing max length in response is breaking](checker/checker_breaking_min_max_test.go?plain=1#L93) [increasing min items in request is breaking](checker/checker_breaking_min_max_test.go?plain=1#L236) -[modifying a pattern in a schema is breaking](checker/checker_breaking_test.go?plain=1#L490) -[modifying a pattern in request parameter is breaking](checker/checker_breaking_test.go?plain=1#L506) -[modifying the default value of an optional request parameter is breaking](checker/checker_breaking_test.go?plain=1#L536) +[modifying a pattern in a schema is breaking](checker/checker_breaking_test.go?plain=1#L513) +[modifying a pattern in request parameter is breaking](checker/checker_breaking_test.go?plain=1#L530) +[modifying the default value of an optional request parameter is breaking](checker/checker_breaking_test.go?plain=1#L561) [new header, query and cookie required request default param is breaking](checker/check-new-request-non-path-default-parameter_test.go?plain=1#L11) -[new required header param is breaking](checker/checker_breaking_test.go?plain=1#L171) -[new required path param is breaking](checker/checker_breaking_test.go?plain=1#L155) +[new required header param is breaking](checker/checker_breaking_test.go?plain=1#L179) +[new required path param is breaking](checker/checker_breaking_test.go?plain=1#L162) [new required property in request header is breaking](checker/checker_breaking_property_test.go?plain=1#L17) [reducing max in request is breaking](checker/checker_breaking_min_max_test.go?plain=1#L264) [reducing max length in request is breaking](checker/checker_breaking_min_max_test.go?plain=1#L12) [reducing min items in response is breaking](checker/checker_breaking_min_max_test.go?plain=1#L220) [reducing min length in response is breaking](checker/checker_breaking_min_max_test.go?plain=1#L62) -[removing 'allOf' subschema from the request body or request body property is breaking with warn](checker/checker_breaking_test.go?plain=1#L715) -[removing 'anyOf' schema from the request body or request body property is breaking](checker/checker_breaking_test.go?plain=1#L650) -[removing 'oneOf' schema from the request body or request body property is breaking](checker/checker_breaking_test.go?plain=1#L672) -[removing a media type from request body is breaking](checker/checker_breaking_test.go?plain=1#L634) +[removing 'allOf' subschema from the request body or request body property is breaking with warn](checker/checker_breaking_test.go?plain=1#L740) +[removing 'anyOf' schema from the request body or request body property is breaking](checker/checker_breaking_test.go?plain=1#L675) +[removing 'oneOf' schema from the request body or request body property is breaking](checker/checker_breaking_test.go?plain=1#L697) +[removing a media type from request body is breaking](checker/checker_breaking_test.go?plain=1#L659) [removing a success status is breaking](checker/check-response-status-updated_test.go?plain=1#L86) -[removing an existing optional response header is breaking as warn](checker/checker_breaking_test.go?plain=1#L409) -[removing an existing required response header is breaking as error](checker/checker_breaking_test.go?plain=1#L226) -[removing an existing response with non-successful status is breaking (optional)](checker/checker_breaking_test.go?plain=1#L263) -[removing an existing response with successful status is breaking](checker/checker_breaking_test.go?plain=1#L245) -[removing an schema object from components is breaking (optional)](checker/checker_breaking_test.go?plain=1#L609) -[removing the default value of an optional request parameter is breaking](checker/checker_breaking_test.go?plain=1#L572) +[removing an existing optional response header is breaking as warn](checker/checker_breaking_test.go?plain=1#L428) +[removing an existing required response header is breaking as error](checker/checker_breaking_test.go?plain=1#L237) +[removing an existing response with non-successful status is breaking (optional)](checker/checker_breaking_test.go?plain=1#L276) +[removing an existing response with successful status is breaking](checker/checker_breaking_test.go?plain=1#L257) +[removing an schema object from components is breaking (optional)](checker/checker_breaking_test.go?plain=1#L634) +[removing the default value of an optional request parameter is breaking](checker/checker_breaking_test.go?plain=1#L597) [removing the path without a deprecation policy and without specifying sunset date is breaking if some APIs are not alpha stability level](checker/checker_deprecation_test.go?plain=1#L135) [removing the path without a deprecation policy and without specifying sunset date is breaking if some APIs are not draft stability level](checker/checker_deprecation_test.go?plain=1#L189) -[removing/updating a property enum in response is breaking (optional)](checker/checker_breaking_test.go?plain=1#L323) -[removing/updating a tag is breaking (optional)](checker/checker_breaking_test.go?plain=1#L340) -[removing/updating an enum in request body is breaking (optional)](checker/checker_breaking_test.go?plain=1#L301) -[removing/updating an operation id is breaking (optional)](checker/checker_breaking_test.go?plain=1#L281) -[setting the default value of an optional request parameter is breaking](checker/checker_breaking_test.go?plain=1#L554) +[removing/updating a property enum in response is breaking (optional)](checker/checker_breaking_test.go?plain=1#L339) +[removing/updating a tag is breaking (optional)](checker/checker_breaking_test.go?plain=1#L357) +[removing/updating an enum in request body is breaking (optional)](checker/checker_breaking_test.go?plain=1#L316) +[removing/updating an operation id is breaking (optional)](checker/checker_breaking_test.go?plain=1#L295) +[setting the default value of an optional request parameter is breaking](checker/checker_breaking_test.go?plain=1#L579) ## Examples of non-breaking changes [adding a media-type to response is not breaking](checker/checker_not_breaking_test.go?plain=1#L185) @@ -115,7 +115,7 @@ These examples are automatically generated from unit tests. [changing response's body schema type from number/none to integer/int32 is not breaking](checker/checker_breaking_response_type_changed_test.go?plain=1#L89) [changing servers is not breaking](checker/checker_not_breaking_test.go?plain=1#L253) [deleting a path after sunset date of all contained operations is not breaking](checker/checker_deprecation_test.go?plain=1#L256) -[deleting a pattern from a schema is not breaking](checker/checker_breaking_test.go?plain=1#L444) +[deleting a pattern from a schema is not breaking](checker/checker_breaking_test.go?plain=1#L465) [deleting a required write-only property in response body is not breaking](checker/checker_breaking_property_test.go?plain=1#L494) [deleting a tag is not breaking](checker/checker_not_breaking_test.go?plain=1#L71) [deleting an operation after sunset date is not breaking](checker/checker_deprecation_test.go?plain=1#L67) @@ -127,8 +127,8 @@ These examples are automatically generated from unit tests. [deprecating an operation without a deprecation policy and without specifying sunset date is not breaking](checker/checker_deprecation_test.go?plain=1#L101) [increasing max length in request is not breaking](checker/checker_breaking_min_max_test.go?plain=1#L76) [increasing min items in response is not breaking](checker/checker_breaking_min_max_test.go?plain=1#L250) -[modifying a pattern to ".*" in a schema is not breaking](checker/checker_breaking_test.go?plain=1#L522) -[modifying the default value of a required request parameter is not breaking](checker/checker_breaking_test.go?plain=1#L590) +[modifying a pattern to ".*" in a schema is not breaking](checker/checker_breaking_test.go?plain=1#L547) +[modifying the default value of a required request parameter is not breaking](checker/checker_breaking_test.go?plain=1#L615) [new optional header param is not breaking](checker/checker_not_breaking_test.go?plain=1#L119) [new optional property in request header is not breaking](checker/checker_breaking_property_test.go?plain=1#L38) [new required response header param is not breaking](checker/checker_not_breaking_test.go?plain=1#L153) @@ -137,11 +137,11 @@ These examples are automatically generated from unit tests. [reducing max length in response is not breaking](checker/checker_breaking_min_max_test.go?plain=1#L31) [reducing min items in request is not breaking](checker/checker_breaking_min_max_test.go?plain=1#L206) [reducing min length in request is not breaking](checker/checker_breaking_min_max_test.go?plain=1#L48) -[removing an existing response with error status is not breaking](checker/checker_breaking_test.go?plain=1#L393) -[removing an existing response with unparseable status is not breaking](checker/checker_breaking_test.go?plain=1#L377) +[removing an existing response with error status is not breaking](checker/checker_breaking_test.go?plain=1#L412) +[removing an existing response with unparseable status is not breaking](checker/checker_breaking_test.go?plain=1#L396) [removing the path without a deprecation policy and without specifying sunset date is not breaking for alpha level](checker/checker_deprecation_test.go?plain=1#L116) [removing the path without a deprecation policy and without specifying sunset date is not breaking for draft level](checker/checker_deprecation_test.go?plain=1#L170) -[renaming a path parameter is not breaking](checker/checker_breaking_test.go?plain=1#L135) +[renaming a path parameter is not breaking](checker/checker_breaking_test.go?plain=1#L142) ## Examples of info-level changes for changelog [adding 'allOf' subschema to the request body or request body property](checker/check-request-property-all-of-updated_test.go?plain=1#L11) diff --git a/checker/checker_breaking_test.go b/checker/checker_breaking_test.go index 34cf8ad1..66c365db 100644 --- a/checker/checker_breaking_test.go +++ b/checker/checker_breaking_test.go @@ -45,6 +45,7 @@ func TestBreaking_DeletedPath(t *testing.T) { errs := d(t, getConfig(), 1, 701) require.Len(t, errs, 1) require.Equal(t, checker.APIPathRemovedWithoutDeprecationId, errs[0].GetId()) + require.Equal(t, "api path removed without deprecation", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: deleting an operation is breaking @@ -60,6 +61,7 @@ func TestBreaking_DeletedOp(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.APIRemovedWithoutDeprecationId, errs[0].GetId()) + require.Equal(t, "api removed without deprecation", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: adding a required request body is breaking @@ -77,6 +79,7 @@ func TestBreaking_AddingRequiredRequestBody(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.AddedRequiredRequestBodyId, errs[0].GetId()) + require.Equal(t, "added required request body", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: changing an existing request body from optional to required is breaking @@ -98,6 +101,7 @@ func TestBreaking_RequestBodyRequiredEnabled(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.RequestBodyBecameRequiredId, errs[0].GetId()) + require.Equal(t, "request body became required", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: deleting an enum value is breaking @@ -106,6 +110,7 @@ func TestBreaking_DeletedEnum(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.RequestParameterEnumValueRemovedId, errs[0].GetId()) + require.Equal(t, "removed the enum value 'removed-value' from the 'path' request parameter 'domain'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: added an enum value to response breaking @@ -114,7 +119,9 @@ func TestBreaking_AddedResponseEnum(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 2) require.Equal(t, checker.ResponsePropertyEnumValueAddedId, errs[0].GetId()) + require.Equal(t, "added the new 'QWE' enum value to the 'respenum' response property for the response status 'default'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) require.Equal(t, checker.ResponsePropertyEnumValueAddedId, errs[1].GetId()) + require.Equal(t, "added the new 'TER2' enum value to the 'respenum2/respenum3' response property for the response status 'default'", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } func deleteParam(op *openapi3.Operation, in string, name string) { @@ -166,6 +173,7 @@ func TestBreaking_NewPathParam(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.NewRequestPathParameterId, errs[0].GetId()) + require.Equal(t, "added the new path request parameter 'project'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: new required header param is breaking @@ -182,6 +190,7 @@ func TestBreaking_NewRequiredHeaderParam(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.NewRequiredRequestParameterId, errs[0].GetId()) + require.Equal(t, "added the new required 'header' request parameter 'network-policies'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: changing an existing header param from optional to required is breaking @@ -205,6 +214,7 @@ func TestBreaking_HeaderParamRequiredEnabled(t *testing.T) { Path: "/api/{domain}/{project}/install-command", Source: "../data/openapi-test1.yaml", }, errs[0]) + require.Equal(t, "the 'header' request parameter 'network-policies' became required", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: changing an existing response header from required to optional is breaking @@ -221,6 +231,7 @@ func TestBreaking_ResponseHeaderParamRequiredDisabled(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.ResponseHeaderBecameOptionalId, errs[0].GetId()) + require.Equal(t, "the response header 'X-RateLimit-Limit' became optional for the status 'default'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: removing an existing required response header is breaking as error @@ -240,6 +251,7 @@ func TestBreaking_ResponseHeaderRemoved(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.RequiredResponseHeaderRemovedId, errs[0].GetId()) + require.Equal(t, "the mandatory response header 'X-RateLimit-Limit' removed for the status 'default'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: removing an existing response with successful status is breaking @@ -258,6 +270,7 @@ func TestBreaking_ResponseSuccessStatusUpdated(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.ResponseSuccessStatusRemovedId, errs[0].GetId()) + require.Equal(t, "removed the success response with the status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: removing an existing response with non-successful status is breaking (optional) @@ -276,6 +289,7 @@ func TestBreaking_ResponseNonSuccessStatusUpdated(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.ResponseNonSuccessStatusRemovedId, errs[0].GetId()) + require.Equal(t, "removed the non-success response with the status '400'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: removing/updating an operation id is breaking (optional) @@ -295,6 +309,7 @@ func TestBreaking_OperationIdRemoved(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.APIOperationIdRemovedId, errs[0].GetId()) + require.Equal(t, "api operation id 'GetSecurityScores' removed and replaced with 'newOperationId'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) verifyNonBreakingChangeIsChangelogEntry(t, d, osm, checker.APIOperationIdRemovedId) } @@ -311,13 +326,14 @@ func TestBreaking_RequestBodyEnumRemoved(t *testing.T) { d, osm, err := diff.GetWithOperationsSourcesMap(getConfig(), s1, s2) require.NoError(t, err) - errs := checker.CheckBackwardCompatibility(checker.GetChecks(utils.StringList{"request-body-enum-value-removed"}), d, osm) + errs := checker.CheckBackwardCompatibility(checker.GetChecks(utils.StringList{checker.RequestBodyEnumValueRemovedId}), d, osm) for _, err := range errs { require.Equal(t, checker.ERR, err.GetLevel()) } require.Len(t, errs, 3) - require.Equal(t, "request-body-enum-value-removed", errs[0].GetId()) + require.Equal(t, checker.RequestBodyEnumValueRemovedId, errs[0].GetId()) + require.Equal(t, "request body enum value removed 'VALUE_1'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: removing/updating a property enum in response is breaking (optional) @@ -335,6 +351,7 @@ func TestBreaking_ResponsePropertyEnumRemoved(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 2) require.Equal(t, checker.ResponsePropertyEnumValueRemovedId, errs[0].GetId()) + require.Equal(t, "removed the 'QWE' enum value from the 'respenum' response property for the response status 'default'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: removing/updating a tag is breaking (optional) @@ -353,6 +370,7 @@ func TestBreaking_TagRemoved(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.APITagRemovedId, errs[0].GetId()) + require.Equal(t, "api tag 'security' removed", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: removing/updating a media type enum in response (optional) @@ -372,6 +390,7 @@ func TestBreaking_ResponseMediaTypeEnumRemoved(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.ResponseMediaTypeEnumValueRemovedId, errs[0].GetId()) + require.Equal(t, "response schema 'application/json' enum value removed 'VALUE_3'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: removing an existing response with unparseable status is not breaking @@ -423,6 +442,7 @@ func TestBreaking_OptionalResponseHeaderRemoved(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.OptionalResponseHeaderRemovedId, errs[0].GetId()) + require.Equal(t, "the optional response header 'X-RateLimit-Limit' removed for the status 'default'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: deleting a media-type from response is breaking @@ -439,6 +459,7 @@ func TestBreaking_ResponseDeleteMediaType(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.ResponseMediaTypeRemovedId, errs[0].GetId()) + require.Equal(t, "removed the media type 'application/json' for the response with the status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: deleting a pattern from a schema is not breaking @@ -469,6 +490,7 @@ func TestBreaking_AddPattern(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, "request-property-pattern-added", errs[0].GetId()) + require.Equal(t, "added the pattern '^[a-z]+$' to the request property 'created'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: adding a pattern to a schema is breaking for recursive properties @@ -485,6 +507,7 @@ func TestBreaking_AddPatternRecursive(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, "request-property-pattern-added", errs[0].GetId()) + require.Equal(t, "added the pattern '^[a-z]+$' to the request property 'data/created'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: modifying a pattern in a schema is breaking @@ -501,6 +524,7 @@ func TestBreaking_ModifyPattern(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.RequestPropertyPatternChangedId, errs[0].GetId()) + require.Equal(t, "changed the pattern of the request property 'created' from '^[a-z]+$' to '.+'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: modifying a pattern in request parameter is breaking @@ -517,6 +541,7 @@ func TestBreaking_ModifyParameterPattern(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.RequestParameterPatternChangedId, errs[0].GetId()) + require.Equal(t, "changed the pattern of the 'path' request parameter 'groupId' from '[0-9a-f]+' to '[0-9]+'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: modifying a pattern to ".*" in a schema is not breaking diff --git a/checker/localizations/localizations.go b/checker/localizations/localizations.go index 94fafb96..71813012 100644 --- a/checker/localizations/localizations.go +++ b/checker/localizations/localizations.go @@ -1,6 +1,6 @@ // Code generated by go-localize; DO NOT EDIT. // This file was generated by robots at -// 2023-11-17 23:04:32.065389 +0200 IST m=+0.011053992 +// 2023-12-07 14:10:48.490852 +0200 IST m=+0.014504590 package localizations @@ -14,7 +14,7 @@ import ( var localizations = map[string]string{ "en.messages.added-required-request-body": "added required request body", "en.messages.added-required-request-body-description": "required request body added", - "en.messages.api-deprecated-sunset-parse": "api sunset date '%s' can't be parsed for deprecated API: %v", + "en.messages.api-deprecated-sunset-parse": "api sunset date %s can't be parsed for deprecated API: %v", "en.messages.api-deprecated-sunset-parse-description": "endpoint deprecated with invalid or missing sunset date", "en.messages.api-global-security-added": "the security scheme %s was added to the API", "en.messages.api-global-security-added-description": "security scheme added in security", @@ -67,7 +67,7 @@ var localizations = map[string]string{ "en.messages.api-stability-decreased-description": "endpoint stability level decreased", "en.messages.api-sunset-date-changed-too-small": "api sunset date changed to earlier date from %s to %s, new sunset date must be not earlier than %s at least %d days from now", "en.messages.api-sunset-date-changed-too-small-description": "modified sunset date doesn't meet min required deprecation days", - "en.messages.api-sunset-date-too-small": "api sunset date '%s' is too small, must be at least %d days from now", + "en.messages.api-sunset-date-too-small": "api sunset date %s is too small, must be at least %d days from now", "en.messages.api-sunset-date-too-small-description": "deprecated endpoint sunset before min required deprecation days", "en.messages.api-tag-added": "api tag %s added", "en.messages.api-tag-added-description": "endpoint tag added", @@ -244,11 +244,11 @@ var localizations = map[string]string{ "en.messages.request-parameter-min-set": "for the %s request parameter %s, the min was set to %s", "en.messages.request-parameter-min-set-comment": "This is a warning because sometimes it is required to be set because of security reasons or current error in specification. But good clients should be checked to support this restriction before such change in specification.", "en.messages.request-parameter-min-set-description": "request parameter min set", - "en.messages.request-parameter-pattern-added": "added the pattern '%s' to the %s request parameter %s", + "en.messages.request-parameter-pattern-added": "added the pattern %s to the %s request parameter %s", "en.messages.request-parameter-pattern-added-description": "request parameter pattern set", - "en.messages.request-parameter-pattern-changed": "changed the pattern of the %s request parameter %s from '%s' to '%s'", + "en.messages.request-parameter-pattern-changed": "changed the pattern of the %s request parameter %s from %s to %s", "en.messages.request-parameter-pattern-changed-description": "request parameter pattern changed", - "en.messages.request-parameter-pattern-removed": "removed the pattern '%s' from the %s request parameter %s", + "en.messages.request-parameter-pattern-removed": "removed the pattern %s from the %s request parameter %s", "en.messages.request-parameter-pattern-removed-description": "request parameter pattern unset", "en.messages.request-parameter-removed": "deleted the %s request parameter %s", "en.messages.request-parameter-removed-description": "request parameter deleted", @@ -331,17 +331,17 @@ var localizations = map[string]string{ "en.messages.request-property-one-of-added-description": "sub-schema added to oneOf in request property", "en.messages.request-property-one-of-removed": "removed %s from the %s request property 'oneOf' list", "en.messages.request-property-one-of-removed-description": "sub-schema deleted from oneOf in request property", - "en.messages.request-property-pattern-added": "added the pattern '%s' to the request property %s", + "en.messages.request-property-pattern-added": "added the pattern %s to the request property %s", "en.messages.request-property-pattern-added-description": "request property pattern set", - "en.messages.request-property-pattern-changed": "changed the pattern of the request property %s from '%s' to '%s'", + "en.messages.request-property-pattern-changed": "changed the pattern of the request property %s from %s to %s", "en.messages.request-property-pattern-changed-description": "request property pattern changed", - "en.messages.request-property-pattern-removed": "removed the pattern '%s' from the request property %s", + "en.messages.request-property-pattern-removed": "removed the pattern %s from the request property %s", "en.messages.request-property-pattern-removed-description": "request property pattern unset", "en.messages.request-property-removed": "removed the request property %s", "en.messages.request-property-removed-description": "request property removed", "en.messages.request-property-type-changed": "the %s request property type/format changed from %s/%s to %s/%s", "en.messages.request-property-type-changed-description": "request property type changed", - "en.messages.request-property-x-extensible-enum-value-removed": "removed the x-extensible-enum value '%s' of the request property %s", + "en.messages.request-property-x-extensible-enum-value-removed": "removed the x-extensible-enum value %s of the request property %s", "en.messages.request-property-x-extensible-enum-value-removed-description": "request property x-extensible-enum value removed", "en.messages.request-required-property-became-not-read-only": "the request required property %s became not read-only", "en.messages.request-required-property-became-not-read-only-description": "request required property became not read-only", @@ -461,10 +461,10 @@ var localizations = map[string]string{ "en.messages.response-property-discriminator-property-name-changed-description": "response property discriminator property name changed", "en.messages.response-property-discriminator-removed": "removed discriminator from %s response property for the response status %s", "en.messages.response-property-discriminator-removed-description": "response property discriminator removed", - "en.messages.response-property-enum-value-added": "added the new '%s' enum value to the %s response property for the response status %s", + "en.messages.response-property-enum-value-added": "added the new %s enum value to the %s response property for the response status %s", "en.messages.response-property-enum-value-added-comment": "Adding new enum values to response could be unexpected for clients, use x-extensible-enum instead.", "en.messages.response-property-enum-value-added-description": "response property enum value added", - "en.messages.response-property-enum-value-removed": "removed the '%s' enum value from the %s response property for the response status %s", + "en.messages.response-property-enum-value-removed": "removed the %s enum value from the %s response property for the response status %s", "en.messages.response-property-enum-value-removed-description": "response property enum value removed", "en.messages.response-property-max-increased": "the %s response property's max was increased from %s to %s for the response status %s", "en.messages.response-property-max-increased-description": "response property max increased", @@ -517,7 +517,7 @@ var localizations = map[string]string{ "en.messages.response-write-only-property-became-optional-description": "response write-only property became optional", "en.messages.response-write-only-property-became-required": "the response write-only property %s became required for the status %s", "en.messages.response-write-only-property-became-required-description": "response write-only property became required", - "en.messages.response-write-only-property-enum-value-added": "added the new '%s' enum value to the %s response write-only property for the response status %s", + "en.messages.response-write-only-property-enum-value-added": "added the new %s enum value to the %s response write-only property for the response status %s", "en.messages.response-write-only-property-enum-value-added-description": "response write-only property enum value added", "en.messages.sunset-deleted": "api sunset date deleted, but deprecated=true kept", "en.messages.sunset-deleted-description": "sunset deleted", @@ -528,7 +528,7 @@ var localizations = map[string]string{ "en.messages.unparseable-property-from-x-extensible-enum-description": "unparseable x-extensible-enum in original request property", "en.messages.unparseable-property-to-x-extensible-enum-description": "unparseable x-extensible-enum in revised request property", "ru.messages.added-required-request-body": "добавлено обязательное тело запроса", - "ru.messages.api-deprecated-sunset-parse": "API deprecated без валидно парсящейся '%s' даты sunset: %v", + "ru.messages.api-deprecated-sunset-parse": "API deprecated без валидно парсящейся %s даты sunset: %v", "ru.messages.api-global-security-added": "схема безопасности %s была добавлена к API", "ru.messages.api-global-security-removed": "схема безопасности %s была удалена из API", "ru.messages.api-global-security-scope-added": "к глобальной схеме безопасности %s была добавлена область безопасности %s", @@ -557,7 +557,7 @@ var localizations = map[string]string{ "ru.messages.api-security-scope-removed": "из схемы безопасности эндпоинта %s была удалена область безопасности %s", "ru.messages.api-security-updated": "схема безопасности точки доступа %s была обновлена с %s на %s", "ru.messages.api-sunset-date-changed-too-small": "дата sunset у API изменена на более раннюю с %s на %s, новая дата sunset должна быть либо не раньше %s, либо, как минимум, %d дней от текущего дня", - "ru.messages.api-sunset-date-too-small": "дата API sunset date '%s' слишком ранняя, должно быть как минимум %d дней от текущего дня", + "ru.messages.api-sunset-date-too-small": "дата API sunset date %s слишком ранняя, должно быть как минимум %d дней от текущего дня", "ru.messages.api-tag-added": "тег API %s добавлен", "ru.messages.api-tag-removed": "Тег API %s удален", "ru.messages.at": "в", @@ -648,9 +648,9 @@ var localizations = map[string]string{ "ru.messages.request-parameter-min-length-increased": "в %s параметре запроса %s, minLength увеличен с %s до %s", "ru.messages.request-parameter-min-set": "в %s параметре запроса %s, min установлен в %s", "ru.messages.request-parameter-min-set-comment": "Это предупреждение, потому что иногда его требуется установить из соображений безопасности или из-за текущей ошибки в спецификации. Но хорошие клиенты должны быть проверены на поддержку этого ограничения перед внесением таких изменений в спецификацию.", - "ru.messages.request-parameter-pattern-added": "добавлен pattern '%s' у %s параметра запроса %s", - "ru.messages.request-parameter-pattern-changed": "изменён pattern у %s параметра запроса %s со значения '%s' на значение '%s'", - "ru.messages.request-parameter-pattern-removed": "удалён pattern '%s' у %s параметра запроса %s", + "ru.messages.request-parameter-pattern-added": "добавлен pattern %s у %s параметра запроса %s", + "ru.messages.request-parameter-pattern-changed": "изменён pattern у %s параметра запроса %s со значения %s на значение %s", + "ru.messages.request-parameter-pattern-removed": "удалён pattern %s у %s параметра запроса %s", "ru.messages.request-parameter-removed": "удалён %s параметр запроса %s", "ru.messages.request-parameter-type-changed": "в %s параметре запроса %s, type/format изменился с %s/%s на %s/%s", "ru.messages.request-parameter-x-extensible-enum-value-removed": "удалено из x-extensible-enum значение %s у %s параметра запроса %s", @@ -694,12 +694,12 @@ var localizations = map[string]string{ "ru.messages.request-property-min-set-comment": "Это предупреждение, потому что иногда его требуется установить из соображений безопасности или из-за текущей ошибки в спецификации. Но хорошие клиенты должны быть проверены на поддержку этого ограничения перед внесением таких изменений в спецификацию.", "ru.messages.request-property-one-of-added": "добавлено %s в список 'oneOf' свойства запроса %s", "ru.messages.request-property-one-of-removed": "удалён %s из списка 'oneOf' свойства запроса %s", - "ru.messages.request-property-pattern-added": "добавлен pattern '%s' у поля запроса %s", - "ru.messages.request-property-pattern-changed": "изменён pattern у поля запроса %s со значения '%s' на значение '%s'", - "ru.messages.request-property-pattern-removed": "удалён pattern '%s' у поля запроса %s", + "ru.messages.request-property-pattern-added": "добавлен pattern %s у поля запроса %s", + "ru.messages.request-property-pattern-changed": "изменён pattern у поля запроса %s со значения %s на значение %s", + "ru.messages.request-property-pattern-removed": "удалён pattern %s у поля запроса %s", "ru.messages.request-property-removed": "удалено поле запроса %s", "ru.messages.request-property-type-changed": "у поля запроса %s изменился type/format с %s/%s на %s/%s", - "ru.messages.request-property-x-extensible-enum-value-removed": "удалено значение x-extensible-enum '%s' в поле запроса %s", + "ru.messages.request-property-x-extensible-enum-value-removed": "удалено значение x-extensible-enum %s в поле запроса %s", "ru.messages.request-required-property-became-not-read-only": "обязательное поле запроса %s перестало быть только для чтения", "ru.messages.request-required-property-became-not-write-only": "обязательное поле запроса %s перестало быть только для записи", "ru.messages.request-required-property-became-read-only": "обязательное поле запроса %s стало только для чтения", @@ -762,7 +762,7 @@ var localizations = map[string]string{ "ru.messages.response-property-discriminator-removed": "удален дискриминатор из свойства ответа %s для статуса ответа %s", "ru.messages.response-property-enum-value-added": "добавлено новое enum значение %s в поле ответа %s для ответа со статусом %s", "ru.messages.response-property-enum-value-added-comment": "Добавление новых значений перечисления в ответ может быть неожиданным для клиентов, вместо этого используйте x-extensible-enum.", - "ru.messages.response-property-enum-value-removed": "удалено значение перечисления '%s' из свойства ответа %s для статуса ответа %s.", + "ru.messages.response-property-enum-value-removed": "удалено значение перечисления %s из свойства ответа %s для статуса ответа %s.", "ru.messages.response-property-max-increased": "у поля ответа %s max увеличен с %s до %s для ответа со статусом %s", "ru.messages.response-property-max-length-increased": "у поля ответа %s maxLength увеличен с %s до %s для ответа со статусом %s", "ru.messages.response-property-max-length-unset": "у поля ответа %s maxLength был удалён, предыдущее значение - %s, для ответа со статусом %s", diff --git a/checker/localizations_src/en/messages.yaml b/checker/localizations_src/en/messages.yaml index f91cfb5d..09745c80 100644 --- a/checker/localizations_src/en/messages.yaml +++ b/checker/localizations_src/en/messages.yaml @@ -4,14 +4,14 @@ added-required-request-body: added required request body request-parameter-removed: deleted the %s request parameter %s total-errors: "%d breaking changes: %d %s, %d %s\\n" total-changes: "%d changes: %d %s, %d %s, %d %s\\n" -request-parameter-pattern-added: "added the pattern '%s' to the %s request parameter %s" -request-parameter-pattern-removed: "removed the pattern '%s' from the %s request parameter %s" -request-parameter-pattern-changed: "changed the pattern of the %s request parameter %s from '%s' to '%s'" -request-property-pattern-added: "added the pattern '%s' to the request property %s" -request-property-pattern-removed: "removed the pattern '%s' from the request property %s" -request-property-pattern-changed: "changed the pattern of the request property %s from '%s' to '%s'" -api-deprecated-sunset-parse: "api sunset date '%s' can't be parsed for deprecated API: %v" -api-sunset-date-too-small: "api sunset date '%s' is too small, must be at least %d days from now" +request-parameter-pattern-added: "added the pattern %s to the %s request parameter %s" +request-parameter-pattern-removed: "removed the pattern %s from the %s request parameter %s" +request-parameter-pattern-changed: "changed the pattern of the %s request parameter %s from %s to %s" +request-property-pattern-added: "added the pattern %s to the request property %s" +request-property-pattern-removed: "removed the pattern %s from the request property %s" +request-property-pattern-changed: "changed the pattern of the request property %s from %s to %s" +api-deprecated-sunset-parse: "api sunset date %s can't be parsed for deprecated API: %v" +api-sunset-date-too-small: "api sunset date %s is too small, must be at least %d days from now" endpoint-added: endpoint added endpoint-deprecated: endpoint deprecated endpoint-reactivated: endpoint reactivated @@ -118,7 +118,7 @@ request-property-min-set-comment: This is a warning because sometimes it is requ request-property-removed: removed the request property %s request-body-type-changed: the request's body type/format changed from %s/%s to %s/%s request-property-type-changed: the %s request property type/format changed from %s/%s to %s/%s -request-property-x-extensible-enum-value-removed: removed the x-extensible-enum value '%s' of the request property %s +request-property-x-extensible-enum-value-removed: removed the x-extensible-enum value %s of the request property %s response-header-became-optional: the response header %s became optional for the status %s required-response-header-removed: the mandatory response header %s removed for the status %s optional-response-header-removed: the optional response header %s removed for the status %s @@ -128,9 +128,9 @@ response-optional-property-removed: removed the optional property %s from the re response-property-became-optional: the response property %s became optional for the status %s response-property-became-nullable: the response property %s became nullable for the status %s response-body-became-nullable: the response's body became nullable -response-property-enum-value-added: added the new '%s' enum value to the %s response property for the response status %s +response-property-enum-value-added: added the new %s enum value to the %s response property for the response status %s response-property-enum-value-added-comment: Adding new enum values to response could be unexpected for clients, use x-extensible-enum instead. -response-property-enum-value-removed: removed the '%s' enum value from the %s response property for the response status %s +response-property-enum-value-removed: removed the %s enum value from the %s response property for the response status %s response-body-max-length-increased: the response's body maxLength was increased from %s to %s response-property-max-length-increased: the %s response property's maxLength was increased from %s to %s for the response status %s response-body-max-length-unset: the response's body maxLength was unset from %s @@ -183,7 +183,7 @@ response-property-became-required: the response property %s became required for response-write-only-property-became-required: the response write-only property %s became required for the status %s request-body-media-type-removed: removed the media type %s from the request body request-body-media-type-added: added the media type %s to the request body -response-write-only-property-enum-value-added: added the new '%s' enum value to the %s response write-only property for the response status %s +response-write-only-property-enum-value-added: added the new %s enum value to the %s response write-only property for the response status %s response-required-property-became-write-only: the response required property %s became write-only for the status %s response-required-property-became-read-only: the response required property %s became read-only for the status %s response-required-property-became-not-read-only: the response required property %s became not read-only for the status %s diff --git a/checker/localizations_src/ru/messages.yaml b/checker/localizations_src/ru/messages.yaml index fd7a0234..e95bc64c 100644 --- a/checker/localizations_src/ru/messages.yaml +++ b/checker/localizations_src/ru/messages.yaml @@ -4,14 +4,14 @@ added-required-request-body: добавлено обязательное тел request-parameter-removed: удалён %s параметр запроса %s total-errors: "%d критические изменения: %d %s, %d %s\\n" total-changes: "%d изменений: %d %s, %d %s, %d %s\\n" -request-parameter-pattern-added: добавлен pattern '%s' у %s параметра запроса %s -request-parameter-pattern-removed: удалён pattern '%s' у %s параметра запроса %s -request-parameter-pattern-changed: изменён pattern у %s параметра запроса %s со значения '%s' на значение '%s' -request-property-pattern-added: добавлен pattern '%s' у поля запроса %s -request-property-pattern-removed: удалён pattern '%s' у поля запроса %s -request-property-pattern-changed: изменён pattern у поля запроса %s со значения '%s' на значение '%s' -api-deprecated-sunset-parse: "API deprecated без валидно парсящейся '%s' даты sunset: %v" -api-sunset-date-too-small: дата API sunset date '%s' слишком ранняя, должно быть как минимум %d дней от текущего дня +request-parameter-pattern-added: добавлен pattern %s у %s параметра запроса %s +request-parameter-pattern-removed: удалён pattern %s у %s параметра запроса %s +request-parameter-pattern-changed: изменён pattern у %s параметра запроса %s со значения %s на значение %s +request-property-pattern-added: добавлен pattern %s у поля запроса %s +request-property-pattern-removed: удалён pattern %s у поля запроса %s +request-property-pattern-changed: изменён pattern у поля запроса %s со значения %s на значение %s +api-deprecated-sunset-parse: "API deprecated без валидно парсящейся %s даты sunset: %v" +api-sunset-date-too-small: дата API sunset date %s слишком ранняя, должно быть как минимум %d дней от текущего дня api-path-added: API path добавлено api-path-deprecated: API path deprecated api-path-reactivated: API path реактивирован @@ -118,7 +118,7 @@ request-property-min-set-comment: Это предупреждение, пото request-property-removed: удалено поле запроса %s request-body-type-changed: изменился type/format тела запроса с %s/%s на %s/%s request-property-type-changed: у поля запроса %s изменился type/format с %s/%s на %s/%s -request-property-x-extensible-enum-value-removed: удалено значение x-extensible-enum '%s' в поле запроса %s +request-property-x-extensible-enum-value-removed: удалено значение x-extensible-enum %s в поле запроса %s response-header-became-optional: заголовок ответа %s стал необязательным для ответа со статусом %s required-response-header-removed: удалён ранее обязательный заголовок ответа %s для ответа со статусом %s optional-response-header-removed: удалён ранее необязательный заголовок ответа %s для ответа со статусом %s @@ -130,7 +130,7 @@ response-property-became-nullable: поле ответа %s стало обну response-body-became-nullable: у тела ответа стало обнуляемым response-property-enum-value-added: добавлено новое enum значение %s в поле ответа %s для ответа со статусом %s response-property-enum-value-added-comment: Добавление новых значений перечисления в ответ может быть неожиданным для клиентов, вместо этого используйте x-extensible-enum. -response-property-enum-value-removed: удалено значение перечисления '%s' из свойства ответа %s для статуса ответа %s. +response-property-enum-value-removed: удалено значение перечисления %s из свойства ответа %s для статуса ответа %s. response-body-max-length-increased: у тела ответа maxLength увеличен с %s до %s response-property-max-length-increased: у поля ответа %s maxLength увеличен с %s до %s для ответа со статусом %s response-body-max-length-unset: у тела ответа maxLength был удалён, предыдущее значение - %s