diff --git a/checker/check_api_added_test.go b/checker/check_api_added_test.go index c1067743..99b586ba 100644 --- a/checker/check_api_added_test.go +++ b/checker/check_api_added_test.go @@ -8,7 +8,7 @@ import ( "github.com/tufin/oasdiff/diff" ) -// CL: new paths or path operations +// CL: new paths or path operations: endpoint-added func TestApiAdded_DetectsNewPathsAndNewOperations(t *testing.T) { s1, err := open("../data/new_endpoints/base.yaml") require.NoError(t, err) @@ -36,7 +36,7 @@ func TestApiAdded_DetectsNewPathsAndNewOperations(t *testing.T) { require.Equal(t, "/api/test3", e1.Path) } -// CL: new paths or path operations +// CL: new paths or path operations: endpoint-added func TestApiAdded_DetectsModifiedPathsWithPathParam(t *testing.T) { s1, err := open("../data/new_endpoints/base_with_path_param.yaml") require.NoError(t, err) diff --git a/checker/check_api_deprecation_test.go b/checker/check_api_deprecation_test.go index 5acf8dbd..40ace1ab 100644 --- a/checker/check_api_deprecation_test.go +++ b/checker/check_api_deprecation_test.go @@ -45,7 +45,7 @@ func TestBreaking_DeprecationPast(t *testing.T) { require.Empty(t, errs) } -// BC: deprecating an operation with a deprecation policy and an invalid sunset date is breaking +// BC: deprecating an operation with a deprecation policy and an invalid sunset date is breaking: api-deprecated-sunset-parse func TestBreaking_DeprecationWithInvalidSunset(t *testing.T) { s1, err := open(getDeprecationFile("base.yaml")) @@ -64,7 +64,7 @@ func TestBreaking_DeprecationWithInvalidSunset(t *testing.T) { require.Equal(t, "failed to parse sunset date: 'sunset date doesn't conform with RFC3339: invalid'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: deprecating an operation with a deprecation policy and an invalid stability level is breaking +// BC: deprecating an operation with a deprecation policy and an invalid stability level is breaking: api-invalid-stability-level func TestBreaking_DeprecationWithInvalidStabilityLevel(t *testing.T) { s1, err := open(getDeprecationFile("base.yaml")) @@ -100,7 +100,7 @@ func TestBreaking_DeprecationWithoutSunsetNoPolicy(t *testing.T) { require.Empty(t, errs) } -// BC: deprecating an operation with a deprecation policy but without specifying sunset date is breaking +// BC: deprecating an operation with a deprecation policy but without specifying sunset date is breaking: api-deprecated-sunset-missing func TestBreaking_DeprecationWithoutSunsetWithPolicy(t *testing.T) { s1, err := open(getDeprecationFile("base.yaml")) @@ -211,7 +211,7 @@ func toJson(t *testing.T, value string) json.RawMessage { return data } -// BC: deprecating an operation with a deprecation policy and sunset date before required deprecation period is breaking +// BC: deprecating an operation with a deprecation policy and sunset date before required deprecation period is breaking: api-sunset-date-too-small func TestBreaking_DeprecationWithEarlySunset(t *testing.T) { s1, err := open(getDeprecationFile("base.yaml")) require.NoError(t, err) @@ -231,7 +231,7 @@ func TestBreaking_DeprecationWithEarlySunset(t *testing.T) { require.Equal(t, fmt.Sprintf("sunset date '%s' is too small, must be at least '10' days from now", sunsetDate), errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: deprecating an operation with a deprecation policy and sunset date after required deprecation period is not breaking +// BC: deprecating an operation with a deprecation policy and sunset date after required deprecation period is not breaking: endpoint-deprecated func TestBreaking_DeprecationWithProperSunset(t *testing.T) { s1, err := open(getDeprecationFile("base.yaml")) @@ -249,6 +249,7 @@ func TestBreaking_DeprecationWithProperSunset(t *testing.T) { require.Len(t, errs, 1) // only a non-breaking change detected require.Equal(t, checker.INFO, errs[0].GetLevel()) + require.Equal(t, checker.EndpointDeprecatedId, errs[0].GetId()) require.Equal(t, "endpoint deprecated", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } @@ -267,7 +268,7 @@ func TestBreaking_DeprecationPathPast(t *testing.T) { require.Empty(t, errs) } -// CL: path operations that became deprecated +// CL: path operations that became deprecated: endpoint-deprecated func TestApiDeprecated_DetectsDeprecatedOperations(t *testing.T) { s1, err := open("../data/deprecation/base.yaml") require.NoError(t, err) @@ -290,7 +291,7 @@ func TestApiDeprecated_DetectsDeprecatedOperations(t *testing.T) { require.Equal(t, "endpoint deprecated", e0.GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: path operations that were re-activated +// CL: path operations that were re-activated: endpoint-reactivated func TestApiDeprecated_DetectsReactivatedOperations(t *testing.T) { s1, err := open("../data/deprecation/deprecated-future.yaml") require.NoError(t, err) @@ -313,6 +314,7 @@ func TestApiDeprecated_DetectsReactivatedOperations(t *testing.T) { require.Equal(t, "endpoint reactivated", e0.GetUncolorizedText(checker.NewDefaultLocalizer())) } +// BC: specifying an invalid stability level is breaking: api-invalid-stability-level func TestBreaking_InvaidStability(t *testing.T) { s1, err := open(getDeprecationFile("invalid-stability.yaml")) diff --git a/checker/check_api_operation_id_updated_test.go b/checker/check_api_operation_id_updated_test.go index 50a3e0cd..e2acc4d7 100644 --- a/checker/check_api_operation_id_updated_test.go +++ b/checker/check_api_operation_id_updated_test.go @@ -9,7 +9,7 @@ import ( "github.com/tufin/oasdiff/load" ) -// CL: removing an existing operation id +// CL: removing an existing operation id: api-operation-id-removed func TestOperationIdRemoved(t *testing.T) { s1, err := open("../data/checker/operation_id_removed_base.yaml") require.NoError(t, err) @@ -31,9 +31,11 @@ func TestOperationIdRemoved(t *testing.T) { Source: load.NewSource("../data/checker/operation_id_removed_base.yaml"), OperationId: "createOneGroup", }, errs[0]) + + require.Equal(t, "api operation id 'createOneGroup' removed and replaced with ''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: updating an existing operation id +// CL: updating an existing operation id: api-operation-id-removed func TestOperationIdUpdated(t *testing.T) { s1, err := open("../data/checker/operation_id_removed_base.yaml") require.NoError(t, err) @@ -59,7 +61,7 @@ func TestOperationIdUpdated(t *testing.T) { require.Equal(t, "api operation id 'createOneGroup' removed and replaced with 'newOperationId'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: adding a new operation id +// CL: adding a new operation id: api-operation-id-added func TestOperationIdAdded(t *testing.T) { s1, err := open("../data/checker/operation_id_added_base.yaml") require.NoError(t, err) diff --git a/checker/check_api_removed_test.go b/checker/check_api_removed_test.go index bc52ce33..773f4a21 100644 --- a/checker/check_api_removed_test.go +++ b/checker/check_api_removed_test.go @@ -8,7 +8,7 @@ import ( "github.com/tufin/oasdiff/diff" ) -// BC: deleting an operation before sunset date is breaking +// BC: deleting an operation before sunset date is breaking: api-removed-before-sunset func TestBreaking_RemoveBeforeSunset(t *testing.T) { s1, err := open(getDeprecationFile("deprecated-future.yaml")) @@ -41,7 +41,7 @@ func TestBreaking_DeprecationNoSunset(t *testing.T) { require.Empty(t, errs) } -// BC: removing the path without a deprecation policy and without specifying sunset date is breaking if some APIs are not alpha stability level +// BC: removing the path without a deprecation policy and without specifying sunset date is breaking if some APIs are not alpha stability level: api-path-removed-without-deprecation func TestBreaking_RemovedPathForAlphaBreaking(t *testing.T) { s1, err := open(getDeprecationFile("base-alpha-stability.yaml")) require.NoError(t, err) @@ -61,7 +61,7 @@ func TestBreaking_RemovedPathForAlphaBreaking(t *testing.T) { require.Equal(t, "api path removed without deprecation", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: removing the path without a deprecation policy and without specifying sunset date is breaking if some APIs are not draft stability level +// BC: removing the path without a deprecation policy and without specifying sunset date is breaking if some APIs are not draft stability level: api-path-removed-without-deprecation func TestBreaking_RemovedPathForDraftBreaking(t *testing.T) { s1, err := open(getDeprecationFile("base-alpha-stability.yaml")) require.NoError(t, err) @@ -83,7 +83,7 @@ func TestBreaking_RemovedPathForDraftBreaking(t *testing.T) { require.Equal(t, "api path removed without deprecation", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: deleting a path with some operations having sunset date in the future is breaking +// BC: deleting a path with some operations having sunset date in the future is breaking: api-path-removed-before-sunset func TestBreaking_DeprecationPathMixed(t *testing.T) { s1, err := open(getDeprecationFile("deprecated-path-mixed.yaml")) @@ -101,7 +101,7 @@ func TestBreaking_DeprecationPathMixed(t *testing.T) { require.Equal(t, "api path removed before the sunset date '9999-08-10'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: removing a deprecated enpoint with an invalid date is breaking +// BC: removing a deprecated enpoint with an invalid date is breaking: api-path-sunset-parse func TestBreaking_RemoveEndpointWithInvalidSunset(t *testing.T) { s1, err := open(getDeprecationFile("deprecated-invalid.yaml")) @@ -122,7 +122,7 @@ func TestBreaking_RemoveEndpointWithInvalidSunset(t *testing.T) { require.Equal(t, "../data/deprecation/deprecated-invalid.yaml", errs[0].GetSource()) } -// test sunset date without double quotes, see https://github.com/Tufin/oasdiff/pull/198/files +// test sunset date without double quotes, see https://github.com/Tufin/oasdiff/pull/198/files: api-path-removed-before-sunset func TestBreaking_DeprecationPathMixed_RFC3339_Sunset(t *testing.T) { s1, err := open(getDeprecationFile("deprecated-path-mixed-rfc3339-sunset.yaml")) diff --git a/checker/check_api_security_updated_test.go b/checker/check_api_security_updated_test.go index 70cfe244..417cbf2b 100644 --- a/checker/check_api_security_updated_test.go +++ b/checker/check_api_security_updated_test.go @@ -9,7 +9,7 @@ import ( "github.com/tufin/oasdiff/load" ) -// CL: adding a new global security to the API +// CL: adding a new global security to the API: api-global-security-added func TestAPIGlobalSecurityyAdded(t *testing.T) { s1, err := open("../data/checker/api_security_global_added_base.yaml") require.NoError(t, err) @@ -25,10 +25,10 @@ func TestAPIGlobalSecurityyAdded(t *testing.T) { Args: []any{"petstore_auth"}, Level: checker.INFO, }, errs[0]) - require.Equal(t, "the security scheme 'petstore_auth' was added to the API", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "security scheme 'petstore_auth' was added", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: removing a global security from the API +// CL: removing a global security from the API: api-global-security-removed func TestAPIGlobalSecurityyDeleted(t *testing.T) { s1, err := open("../data/checker/api_security_global_added_revision.yaml") require.NoError(t, err) @@ -44,10 +44,10 @@ func TestAPIGlobalSecurityyDeleted(t *testing.T) { Args: []any{"petstore_auth"}, Level: checker.INFO, }, errs[0]) - require.Equal(t, "the security scheme 'petstore_auth' was removed from the API", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "removed security scheme 'petstore_auth'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: removing a security scope from an API global security +// CL: removing a security scope from an API global security: api-global-security-scope-removed func TestAPIGlobalSecurityScopeRemoved(t *testing.T) { s1, err := open("../data/checker/api_security_global_added_revision.yaml") require.NoError(t, err) @@ -64,10 +64,10 @@ func TestAPIGlobalSecurityScopeRemoved(t *testing.T) { Args: []any{"read:pets", "petstore_auth"}, Level: checker.INFO, }, errs[0]) - require.Equal(t, "the security scope 'read:pets' was removed from the global security scheme 'petstore_auth'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "removed security scope 'read:pets' from global security scheme 'petstore_auth'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: adding a security scope from an API global security +// CL: adding a security scope from an API global security: api-global-security-scope-added func TestAPIGlobalSecurityScopeAdded(t *testing.T) { s1, err := open("../data/checker/api_security_global_added_revision.yaml") require.NoError(t, err) @@ -84,10 +84,10 @@ func TestAPIGlobalSecurityScopeAdded(t *testing.T) { Args: []any{"read:pets", "petstore_auth"}, Level: checker.INFO, }, errs[0]) - require.Equal(t, "the security scope 'read:pets' was added to the global security scheme 'petstore_auth'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "security scope 'read:pets' was added to global security scheme 'petstore_auth'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: adding a new security to the API endpoint +// CL: adding a new security to the API endpoint: api-security-added func TestAPISecurityAdded(t *testing.T) { s1, err := open("../data/checker/api_security_added_base.yaml") require.NoError(t, err) @@ -106,10 +106,10 @@ func TestAPISecurityAdded(t *testing.T) { Path: "/subscribe", Source: load.NewSource("../data/checker/api_security_added_revision.yaml"), }, errs[0]) - require.Equal(t, "the endpoint scheme security 'petstore_auth' was added to the API", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "endpoint scheme security 'petstore_auth' was added", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: removing a new security to the API endpoint +// CL: removing a new security to the API endpoint: api-security-removed func TestAPISecurityDeleted(t *testing.T) { s1, err := open("../data/checker/api_security_added_revision.yaml") require.NoError(t, err) @@ -128,10 +128,10 @@ func TestAPISecurityDeleted(t *testing.T) { Path: "/subscribe", Source: load.NewSource("../data/checker/api_security_added_base.yaml"), }, errs[0]) - require.Equal(t, "the endpoint scheme security 'petstore_auth' was removed from the API", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "removed endpoint scheme security 'petstore_auth'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: removing a security scope from an API endpoint security +// CL: removing a security scope from an API endpoint security: api-security-scope-removed func TestAPISecurityScopeRemoved(t *testing.T) { s1, err := open("../data/checker/api_security_updated_base.yaml") require.NoError(t, err) @@ -150,10 +150,10 @@ func TestAPISecurityScopeRemoved(t *testing.T) { Path: "/subscribe", Source: load.NewSource("../data/checker/api_security_updated_revision.yaml"), }, errs[0]) - require.Equal(t, "the security scope 'read:pets' was removed from the endpoint's security scheme 'petstore_auth'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "removed security scope 'read:pets' from endpoint security scheme 'petstore_auth'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: adding a security scope to an API endpoint security +// CL: adding a security scope to an API endpoint security: api-security-scope-added func TestAPISecurityScopeAdded(t *testing.T) { s1, err := open("../data/checker/api_security_updated_revision.yaml") require.NoError(t, err) @@ -172,5 +172,5 @@ func TestAPISecurityScopeAdded(t *testing.T) { Path: "/subscribe", Source: load.NewSource("../data/checker/api_security_updated_base.yaml"), }, errs[0]) - require.Equal(t, "the security scope 'read:pets' was added to the endpoint's security scheme 'petstore_auth'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "security scope 'read:pets' was added to endpoint security scheme 'petstore_auth'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_api_sunset_changed_test.go b/checker/check_api_sunset_changed_test.go index 657cf5e9..4777676c 100644 --- a/checker/check_api_sunset_changed_test.go +++ b/checker/check_api_sunset_changed_test.go @@ -8,7 +8,7 @@ import ( "github.com/tufin/oasdiff/diff" ) -// BC: deleting sunset header for a deprecated endpoint is breaking +// BC: deleting sunset header for a deprecated endpoint is breaking: sunset-deleted func TestBreaking_SunsetDeletedForDeprecatedEndpoint(t *testing.T) { s1, err := open(getDeprecationFile("deprecated-with-sunset.yaml")) @@ -26,7 +26,7 @@ func TestBreaking_SunsetDeletedForDeprecatedEndpoint(t *testing.T) { require.Equal(t, "api sunset date deleted, but deprecated=true kept", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing sunset to an earlier date for a deprecated endpoint with a deprecation policy is breaking +// BC: changing sunset to an earlier date for a deprecated endpoint with a deprecation policy is breaking: api-sunset-date-changed-too-small func TestBreaking_SunsetModifiedForDeprecatedEndpoint(t *testing.T) { s1, err := open(getDeprecationFile("deprecated-future.yaml")) @@ -44,7 +44,7 @@ func TestBreaking_SunsetModifiedForDeprecatedEndpoint(t *testing.T) { require.Equal(t, "api sunset date changed to earlier date from '9999-08-10' to '2022-08-10', new sunset date must be not earlier than '9999-08-10' at least '180' days from now", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing sunset to an invalid date for a deprecated endpoint is breaking +// BC: changing sunset to an invalid date for a deprecated endpoint is breaking: api-path-sunset-parse func TestBreaking_SunsetModifiedToInvalidForDeprecatedEndpoint(t *testing.T) { s1, err := open(getDeprecationFile("deprecated-future.yaml")) @@ -62,7 +62,7 @@ func TestBreaking_SunsetModifiedToInvalidForDeprecatedEndpoint(t *testing.T) { require.Equal(t, "failed to parse sunset date: 'sunset date doesn't conform with RFC3339: invalid-date'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing sunset from an invalid date for a deprecated endpoint is breaking +// BC: changing sunset from an invalid date for a deprecated endpoint is breaking: api-path-sunset-parse func TestBreaking_SunsetModifiedFromInvalidForDeprecatedEndpoint(t *testing.T) { s1, err := open(getDeprecationFile("deprecated-invalid.yaml")) diff --git a/checker/check_api_tag_updated_test.go b/checker/check_api_tag_updated_test.go index 620b3b95..4388b692 100644 --- a/checker/check_api_tag_updated_test.go +++ b/checker/check_api_tag_updated_test.go @@ -9,7 +9,7 @@ import ( "github.com/tufin/oasdiff/load" ) -// CL: adding a new tag +// CL: adding a new tag: api-tag-added func TestTagAdded(t *testing.T) { s1, err := open("../data/checker/tag_added_base.yaml") require.NoError(t, err) @@ -31,10 +31,10 @@ func TestTagAdded(t *testing.T) { Source: load.NewSource("../data/checker/tag_added_base.yaml"), OperationId: "createOneGroup", }, errs[0]) - require.Equal(t, "api tag 'newTag' added", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "added api tag 'newTag'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: removing an existing tag +// CL: removing an existing tag: api-tag-removed func TestTagRemoved(t *testing.T) { s1, err := open("../data/checker/tag_removed_base.yaml") require.NoError(t, err) @@ -57,11 +57,11 @@ func TestTagRemoved(t *testing.T) { Source: load.NewSource("../data/checker/tag_removed_base.yaml"), OperationId: "createOneGroup", }, errs[0]) - require.Equal(t, "api tag 'Test' removed", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "removed api tag 'Test'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: updating an existing tag +// CL: updating an existing tag: api-tag-removed, api-tag-added func TestTagUpdated(t *testing.T) { s1, err := open("../data/checker/tag_removed_base.yaml") require.NoError(t, err) diff --git a/checker/check_breaking_min_max_test.go b/checker/check_breaking_min_max_test.go index dbfe69a4..c021be2f 100644 --- a/checker/check_breaking_min_max_test.go +++ b/checker/check_breaking_min_max_test.go @@ -9,7 +9,7 @@ import ( "github.com/tufin/oasdiff/diff" ) -// BC: reducing max length in request is breaking +// BC: reducing max length in request is breaking: request-parameter-max-length-decreased func TestBreaking_RequestMaxLengthSmaller(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -26,6 +26,7 @@ func TestBreaking_RequestMaxLengthSmaller(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.RequestParameterMaxLengthDecreasedId, errs[0].GetId()) + require.Equal(t, "for 'path' request parameter 'domain', maxLength was decreased from '13' to '11'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: reducing max length in response is not breaking @@ -59,7 +60,7 @@ func TestBreaking_RequestMinLengthSmaller(t *testing.T) { require.Empty(t, errs) } -// BC: reducing min length in response is breaking +// BC: reducing min length in response is breaking: response-body-min-length-decreased func TestBreaking_MinLengthSmaller(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -71,6 +72,7 @@ func TestBreaking_MinLengthSmaller(t *testing.T) { require.NoError(t, err) errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) require.Equal(t, checker.ResponseBodyMinLengthDecreasedId, errs[0].GetId()) + require.Equal(t, "minLength value of response body was decreased from '13' to '11'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: increasing max length in request is not breaking @@ -90,7 +92,7 @@ func TestBreaking_RequestMaxLengthGreater(t *testing.T) { require.Empty(t, errs) } -// BC: increasing max length in response is breaking +// BC: increasing max length in response is breaking: response-body-max-length-increased func TestBreaking_ResponseMaxLengthGreater(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -104,10 +106,12 @@ func TestBreaking_ResponseMaxLengthGreater(t *testing.T) { d, osm, err := diff.GetWithOperationsSourcesMap(diff.NewConfig(), s1, s2) require.NoError(t, err) errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) - require.NotEmpty(t, errs) + require.Len(t, errs, 1) + require.Equal(t, checker.ResponseBodyMaxLengthIncreasedId, errs[0].GetId()) + require.Equal(t, "maxLength value of response body was increased from '13' to '14'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing max length in request from nil to any value is breaking +// BC: changing max length in request from nil to any value is breaking: request-parameter-max-length-set func TestBreaking_MaxLengthFromNil(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -123,6 +127,7 @@ func TestBreaking_MaxLengthFromNil(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.RequestParameterMaxLengthSetId, errs[0].GetId()) + require.Equal(t, "for 'path' request parameter 'domain', maxLength was set to '14'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: changing max length in response from nil to any value is not breaking @@ -157,7 +162,7 @@ func TestBreaking_RequestMaxLengthToNil(t *testing.T) { require.Empty(t, errs) } -// BC: changing max length in response from any value to nil is breaking +// BC: changing max length in response from any value to nil is breaking: response-body-max-length-unset func TestBreaking_ResponseMaxLengthToNil(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -173,6 +178,7 @@ func TestBreaking_ResponseMaxLengthToNil(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.ResponseBodyMaxLengthUnsetId, errs[0].GetId()) + require.Equal(t, "maxLength value of response body was unset from '13'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: both max lengths in request are nil is not breaking @@ -217,7 +223,7 @@ func TestBreaking_RequestMinItemsSmaller(t *testing.T) { require.Empty(t, errs) } -// BC: reducing min items in response is breaking +// BC: reducing min items in response is breaking: response-body-min-items-decreased func TestBreaking_ResponseMinItemsSmaller(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -231,9 +237,10 @@ func TestBreaking_ResponseMinItemsSmaller(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.ResponseBodyMinItemsDecreasedId, errs[0].GetId()) + require.Equal(t, "minItems value of response body was decreased from '13' to '11'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: increasing min items in request is breaking +// BC: increasing min items in request is breaking: request-parameter-min-items-increased func TestBreaking_RequeatMinItemsGreater(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -244,7 +251,9 @@ func TestBreaking_RequeatMinItemsGreater(t *testing.T) { d, osm, err := diff.GetWithOperationsSourcesMap(diff.NewConfig(), s1, s2) require.NoError(t, err) errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) - require.NotEmpty(t, errs) + require.Len(t, errs, 1) + require.Equal(t, checker.RequestParameterMinItemsIncreasedId, errs[0].GetId()) + require.Equal(t, "for 'path' request parameter 'domain', minItems was increased from '13' to '14'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: increasing min items in response is not breaking @@ -261,7 +270,7 @@ func TestBreaking_ResponseMinItemsGreater(t *testing.T) { require.Empty(t, errs) } -// BC: reducing max in request is breaking +// BC: reducing max in request is breaking: request-parameter-max-decreased func TestBreaking_MaxSmaller(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -275,7 +284,9 @@ func TestBreaking_MaxSmaller(t *testing.T) { d, osm, err := diff.GetWithOperationsSourcesMap(diff.NewConfig(), s1, s2) require.NoError(t, err) errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) - require.NotEmpty(t, errs) + require.Len(t, errs, 1) + require.Equal(t, checker.RequestParameterMaxDecreasedId, errs[0].GetId()) + require.Equal(t, "for 'path' request parameter 'domain', max was decreased from '13.00' to '11.00'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: reducing max in response is not breaking diff --git a/checker/check_breaking_property_test.go b/checker/check_breaking_property_test.go index f1df2f99..859aeac6 100644 --- a/checker/check_breaking_property_test.go +++ b/checker/check_breaking_property_test.go @@ -15,7 +15,7 @@ func getReqPropFile(file string) string { return fmt.Sprintf("../data/required-properties/%s", file) } -// BC: new required property in request header is breaking +// BC: new required property in request header is breaking: new-required-request-header-property func TestBreaking_NewRequiredProperty(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -34,6 +34,7 @@ func TestBreaking_NewRequiredProperty(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.NewRequiredRequestHeaderPropertyId, errs[0].GetId()) + require.Equal(t, "added required 'network-policies' request header property 'courseId'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: new optional property in request header is not breaking @@ -54,7 +55,7 @@ func TestBreaking_NewNonRequiredProperty(t *testing.T) { require.Empty(t, errs) } -// BC: changing an existing property in request header to required is breaking +// BC: changing an existing property in request header to required is breaking: request-header-property-became-required func TestBreaking_PropertyRequiredEnabled(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -78,6 +79,7 @@ func TestBreaking_PropertyRequiredEnabled(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.RequestHeaderPropertyBecameRequiredId, errs[0].GetId()) + require.Equal(t, "property 'courseId' of request header 'network-policies' became required", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: changing an existing property in request header to optional is not breaking @@ -104,7 +106,7 @@ func TestBreaking_PropertyRequiredDisabled(t *testing.T) { require.Empty(t, errs) } -// BC: changing an existing property in response body to optional is breaking +// BC: changing an existing property in response body to optional is breaking: response-property-became-optional func TestBreaking_RespBodyRequiredPropertyDisabled(t *testing.T) { s1, err := open(getReqPropFile("response-base.json")) require.NoError(t, err) @@ -118,9 +120,10 @@ func TestBreaking_RespBodyRequiredPropertyDisabled(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.ResponsePropertyBecameOptionalId, errs[0].GetId()) + require.Equal(t, "property 'helpAndSupport/title' became optional for response status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing a request body to enum is breaking +// BC: changing a request body to enum is breaking: request-body-became-enum func TestBreaking_ReqBodyBecameEnum(t *testing.T) { s1, err := open("../data/enums/request-body-no-enum.yaml") require.NoError(t, err) @@ -134,6 +137,7 @@ func TestBreaking_ReqBodyBecameEnum(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.RequestBodyBecameEnumId, errs[0].GetId()) + require.Equal(t, "media-type 'application/json' of request body was restricted to a list of enum values", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: adding an enum value to request body is not breaking @@ -150,7 +154,7 @@ func TestBreaking_ReqBodyEnumValueAdded(t *testing.T) { require.Empty(t, errs) } -// BC: changing a request body type and changing it to enum simultaneously is breaking +// BC: changing a request body type and changing it to enum simultaneously is breaking: request-body-became-enum, request-body-type-changed func TestBreaking_ReqBodyBecameEnumAndTypeChanged(t *testing.T) { s1, err := open("../data/enums/request-body-no-enum.yaml") require.NoError(t, err) @@ -162,11 +166,15 @@ func TestBreaking_ReqBodyBecameEnumAndTypeChanged(t *testing.T) { require.NoError(t, err) errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) require.Len(t, errs, 2) + require.Equal(t, checker.RequestBodyBecameEnumId, errs[0].GetId()) + require.Equal(t, "media-type 'application/json' of request body was restricted to a list of enum values", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, checker.RequestBodyTypeChangedId, errs[1].GetId()) + require.Equal(t, "type/format of media-type 'application/json' of request body changed from 'string'/'' to 'int'/''", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing an existing property in request body to enum is breaking +// BC: changing an existing property in request body to enum is breaking: request-property-became-enum func TestBreaking_ReqPropertyBecameEnum(t *testing.T) { s1, err := open("../data/enums/request-property-no-enum.yaml") require.NoError(t, err) @@ -180,9 +188,10 @@ func TestBreaking_ReqPropertyBecameEnum(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.RequestPropertyBecameEnumId, errs[0].GetId()) + require.Equal(t, "request property 'name' of media-type 'application/json' was restricted to a list of enum values", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing an existing path param to enum is breaking +// BC: changing an existing path param to enum is breaking: request-parameter-became-enum func TestBreaking_ReqParameterBecameEnum(t *testing.T) { s1, err := open("../data/enums/request-parameter-op-no-enum.yaml") require.NoError(t, err) @@ -196,9 +205,10 @@ func TestBreaking_ReqParameterBecameEnum(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.RequestParameterBecameEnumId, errs[0].GetId()) + require.Equal(t, "'path' request parameter 'bookId' was restricted to a list of enum values", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing an existing property in request header to enum is breaking +// BC: changing an existing property in request header to enum is breaking: request-header-property-became-enum func TestBreaking_ReqParameterHeaderPropertyBecameEnum(t *testing.T) { s1, err := open("../data/enums/request-parameter-property-no-enum.yaml") require.NoError(t, err) @@ -212,9 +222,10 @@ func TestBreaking_ReqParameterHeaderPropertyBecameEnum(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.RequestHeaderPropertyBecameEnumId, errs[0].GetId()) + require.Equal(t, "property 'name' of request header 'bookId' was restricted to a list of enum values", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing a response body to nullable is breaking +// BC: changing a response body to nullable is breaking: response-body-became-nullable func TestBreaking_RespBodyNullable(t *testing.T) { s1, err := open("../data/nullable/base-body.yaml") require.NoError(t, err) @@ -228,9 +239,10 @@ func TestBreaking_RespBodyNullable(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.ResponseBodyBecameNullableId, errs[0].GetId()) + require.Equal(t, "response body became nullable", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing a request property to not nullable is breaking +// BC: changing a request property to not nullable is breaking: request-property-became-not-nullable func TestBreaking_ReqBodyPropertyNotNullable(t *testing.T) { s1, err := open("../data/nullable/base-req.yaml") require.NoError(t, err) @@ -244,9 +256,10 @@ func TestBreaking_ReqBodyPropertyNotNullable(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.RequestPropertyBecomeNotNullableId, errs[0].GetId()) + require.Equal(t, "request property 'id' of media-type 'application/json' became not nullable", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing a response property to nullable is breaking +// BC: changing a response property to nullable is breaking: response-property-became-nullable func TestBreaking_RespBodyPropertyNullable(t *testing.T) { s1, err := open("../data/nullable/base-property.yaml") require.NoError(t, err) @@ -260,9 +273,10 @@ func TestBreaking_RespBodyPropertyNullable(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.ResponsePropertyBecameNullableId, errs[0].GetId()) + require.Equal(t, "property 'name' became nullable for response status '201'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing an embedded response property to nullable is breaking +// BC: changing an embedded response property to nullable is breaking: response-property-became-nullable func TestBreaking_RespBodyEmbeddedPropertyNullable(t *testing.T) { s1, err := open("../data/nullable/base-embedded-property.yaml") require.NoError(t, err) @@ -276,9 +290,10 @@ func TestBreaking_RespBodyEmbeddedPropertyNullable(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.ResponsePropertyBecameNullableId, errs[0].GetId()) + require.Equal(t, "property 'name/name' became nullable for response status '201'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing a required property in response body to optional and also deleting it is breaking +// BC: changing a required property in response body to optional and also deleting it is breaking: response-required-property-removed func TestBreaking_RespBodyDeleteAndDisableRequiredProperty(t *testing.T) { s1, err := open(getReqPropFile("response-del-required-prop-base.yaml")) require.NoError(t, err) @@ -289,7 +304,9 @@ func TestBreaking_RespBodyDeleteAndDisableRequiredProperty(t *testing.T) { d, osm, err := diff.GetWithOperationsSourcesMap(diff.NewConfig(), s1, s2) require.NoError(t, err) errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) - require.NotEmpty(t, errs) + require.Len(t, errs, 1) + require.Equal(t, checker.ResponseRequiredPropertyRemovedId, errs[0].GetId()) + require.Equal(t, "removed required property 'name' from response status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: adding a non-existent required property in request body is not breaking @@ -334,7 +351,7 @@ func TestBreaking_ReqBodyRequiredPropertyDisabled(t *testing.T) { require.Empty(t, errs) } -// BC: changing an existing property in request body to required is breaking +// BC: changing an existing property in request body to required is breaking: request-property-became-required func TestBreaking_ReqBodyRequiredPropertyEnabled(t *testing.T) { s1, err := open(getReqPropFile("request-revision.yaml")) require.NoError(t, err) @@ -348,9 +365,10 @@ func TestBreaking_ReqBodyRequiredPropertyEnabled(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.RequestPropertyBecameRequiredId, errs[0].GetId()) + require.Equal(t, "request property 'email' of media-type 'application/json' became required", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: adding a new required property in request body is breaking +// BC: adding a new required property in request body is breaking: new-required-request-property func TestBreaking_ReqBodyNewRequiredProperty(t *testing.T) { s1, err := open(getReqPropFile("request-new-base.yaml")) require.NoError(t, err) @@ -364,9 +382,10 @@ func TestBreaking_ReqBodyNewRequiredProperty(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.NewRequiredRequestPropertyId, errs[0].GetId()) + require.Equal(t, "added required request property 'email' to media-type 'application/json'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: deleting a required property in request is breaking with warn +// BC: deleting a required property in request is breaking with warn: request-property-removed func TestBreaking_ReqBodyDeleteRequiredProperty(t *testing.T) { s1, err := open(getReqPropFile("request-new-revision.yaml")) require.NoError(t, err) @@ -381,9 +400,10 @@ func TestBreaking_ReqBodyDeleteRequiredProperty(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.RequestPropertyRemovedId, errs[0].GetId()) require.Equal(t, checker.WARN, errs[0].GetLevel()) + require.Equal(t, "removed request property 'email' of media-type 'application/json'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: deleting an embedded optional property in request is breaking with warn +// BC: deleting an embedded optional property in request is breaking with warn: request-property-removed func TestBreaking_ReqBodyDeleteRequiredProperty2(t *testing.T) { s1, err := open(getReqPropFile("request-property-items.yaml")) require.NoError(t, err) @@ -396,12 +416,13 @@ func TestBreaking_ReqBodyDeleteRequiredProperty2(t *testing.T) { errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) require.Contains(t, errs, checker.ApiChange{ Id: checker.RequestPropertyRemovedId, - Args: []any{"roleAssignments/items/role"}, + Args: []any{"roleAssignments/items/role", "application/json"}, Level: checker.WARN, Operation: "POST", Path: "/api/roleMappings", Source: load.NewSource("../data/required-properties/request-property-items-2.yaml"), }) + require.Equal(t, "removed request property 'roleAssignments/items/role' of media-type 'application/json'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: adding a new required property in response body is not breaking @@ -418,7 +439,7 @@ func TestBreaking_RespBodyNewRequiredProperty(t *testing.T) { require.Empty(t, errs) } -// BC: deleting a required property in response body is breaking +// BC: deleting a required property in response body is breaking: response-required-property-removed func TestBreaking_RespBodyDeleteRequiredProperty(t *testing.T) { s1, err := open(getReqPropFile("response-new-revision.json")) require.NoError(t, err) @@ -432,6 +453,7 @@ func TestBreaking_RespBodyDeleteRequiredProperty(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.ResponseRequiredPropertyRemovedId, errs[0].GetId()) + require.Equal(t, "removed required property 'helpAndSupport/title' from response status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: adding a new required property under AllOf in response body is not breaking @@ -448,7 +470,7 @@ func TestBreaking_RespBodyNewAllOfRequiredProperty(t *testing.T) { require.Empty(t, errs) } -// BC: deleting a required property under AllOf in response body is breaking +// BC: deleting a required property under AllOf in response body is breaking: response-required-property-removed func TestBreaking_RespBodyDeleteAllOfRequiredProperty(t *testing.T) { s1, err := open(getReqPropFile("response-allof-revision.json")) require.NoError(t, err) @@ -462,6 +484,7 @@ func TestBreaking_RespBodyDeleteAllOfRequiredProperty(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.ResponseRequiredPropertyRemovedId, errs[0].GetId()) + require.Equal(t, "removed required property '/allOf[subschema #1]/bazqux' from response status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: adding a new required read-only property in request body is not breaking @@ -492,7 +515,7 @@ func TestBreaking_ReadOnlyPropertyRequiredEnabled(t *testing.T) { require.Empty(t, errs) } -// BC: deleting a required write-only property in response body is not breaking +// BC: deleting a required write-only property in response body is not breaking: request-property-removed func TestBreaking_WriteOnlyDeleteRequiredProperty(t *testing.T) { s1, err := open(getReqPropFile("write-only-delete-base.yaml")) require.NoError(t, err) @@ -507,9 +530,10 @@ func TestBreaking_WriteOnlyDeleteRequiredProperty(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.RequestPropertyRemovedId, errs[0].GetId()) require.Equal(t, checker.WARN, errs[0].GetLevel()) + require.Equal(t, "removed request property 'test' of media-type 'application/json'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: deleting a non-required non-write-only property in response body is breaking with warning +// BC: deleting a non-required non-write-only property in response body is breaking with warning: request-property-removed, response-optional-property-removed func TestBreaking_WriteOnlyDeleteNonRequiredProperty(t *testing.T) { s1, err := open(getReqPropFile("write-only-delete-partial-base.yaml")) require.NoError(t, err) @@ -522,12 +546,21 @@ func TestBreaking_WriteOnlyDeleteNonRequiredProperty(t *testing.T) { errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) require.NotEmpty(t, errs) require.Len(t, errs, 3) + require.Equal(t, checker.RequestPropertyRemovedId, errs[0].GetId()) require.Equal(t, checker.WARN, errs[0].GetLevel()) - require.Equal(t, checker.ResponseOptionalPropertyRemovedId, errs[1].GetId()) + require.Equal(t, "/api/atlas/v1.0/groups", errs[0].GetPath()) + require.Equal(t, "removed request property 'test' of media-type 'application/json'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, checker.WARN, errs[1].GetLevel()) - require.Equal(t, checker.ResponseOptionalPropertyRemovedId, errs[2].GetId()) + require.Equal(t, checker.ResponseOptionalPropertyRemovedId, errs[1].GetId()) + require.Equal(t, "/api/atlas/v1.0/groups", errs[1].GetPath()) + require.Equal(t, "removed optional property 'test' from response status '200'", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, checker.WARN, errs[2].GetLevel()) + require.Equal(t, checker.ResponseOptionalPropertyRemovedId, errs[2].GetId()) + require.Equal(t, "/api/atlas/v1.0/groups/{groupId}", errs[2].GetPath()) + require.Equal(t, "removed optional property 'test' from response status '200'", errs[2].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: changing an existing write-only property in response body to optional is not breaking @@ -558,7 +591,7 @@ func TestBreaking_RequiredPropertyWriteOnlyEnabled(t *testing.T) { require.Empty(t, errs) } -// BC: changing an existing required property in response body to not-write-only is breaking +// BC: changing an existing required property in response body to not-write-only is breaking: response-required-property-became-not-write-only func TestBreaking_RequiredPropertyWriteOnlyDisabled(t *testing.T) { s1, err := open(getReqPropFile("write-only-changed-revision.yaml")) require.NoError(t, err) @@ -571,13 +604,19 @@ func TestBreaking_RequiredPropertyWriteOnlyDisabled(t *testing.T) { errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) require.NotEmpty(t, errs) require.Len(t, errs, 2) + require.Equal(t, checker.ResponseRequiredPropertyBecameNonWriteOnlyId, errs[0].GetId()) require.Equal(t, checker.WARN, errs[0].GetLevel()) + require.Equal(t, "/api/atlas/v1.0/groups", errs[0].GetPath()) + require.Equal(t, "response required property 'test' became not write-only for status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, checker.ResponseRequiredPropertyBecameNonWriteOnlyId, errs[1].GetId()) require.Equal(t, checker.WARN, errs[1].GetLevel()) + require.Equal(t, "/api/atlas/v1.0/groups/{groupId}", errs[1].GetPath()) + require.Equal(t, "response required property 'test' became not write-only for status '200'", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing an existing property in request body to required is breaking +// BC: changing an existing property in request body to required is breaking: request-property-became-required func TestBreaking_Body(t *testing.T) { s1, err := open(getReqPropFile("body1.yaml")) require.NoError(t, err) @@ -591,10 +630,11 @@ func TestBreaking_Body(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.RequestPropertyBecameRequiredId, errs[0].GetId()) - require.Equal(t, []interface{}{"id"}, errs[0].GetArgs()) + require.Equal(t, []interface{}{"id", "application/json"}, errs[0].GetArgs()) + require.Equal(t, "request property 'id' of media-type 'application/json' became required", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing an existing property in request body items to required is breaking +// BC: changing an existing property in request body items to required is breaking: request-property-became-required func TestBreaking_Items(t *testing.T) { s1, err := open(getReqPropFile("items1.yaml")) require.NoError(t, err) @@ -608,7 +648,8 @@ func TestBreaking_Items(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.RequestPropertyBecameRequiredId, errs[0].GetId()) - require.Equal(t, []interface{}{"/items/id"}, errs[0].GetArgs()) + require.Equal(t, []interface{}{"/items/id", "application/json"}, errs[0].GetArgs()) + require.Equal(t, "request property '/items/id' of media-type 'application/json' became required", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: changing an existing property in request body items to required with a default value is not breaking @@ -625,7 +666,7 @@ func TestBreaking_ItemsWithDefault(t *testing.T) { require.Empty(t, errs) } -// BC: changing an existing property in request body anyOf to required is breaking +// BC: changing an existing property in request body anyOf to required is breaking: request-property-became-required func TestBreaking_AnyOf(t *testing.T) { s1, err := open(getReqPropFile("anyOf1.yaml")) require.NoError(t, err) @@ -639,9 +680,10 @@ func TestBreaking_AnyOf(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.RequestPropertyBecameRequiredId, errs[0].GetId()) + require.Equal(t, "request property '/anyOf[subschema #1]/id' of media-type 'application/json' became required", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing an existing property under another property in request body to required is breaking +// BC: changing an existing property under another property in request body to required is breaking: request-property-became-required func TestBreaking_NestedProp(t *testing.T) { s1, err := open(getReqPropFile("nested-property1.yaml")) require.NoError(t, err) @@ -655,9 +697,10 @@ func TestBreaking_NestedProp(t *testing.T) { require.NotEmpty(t, errs) require.Len(t, errs, 1) require.Equal(t, checker.RequestPropertyBecameRequiredId, errs[0].GetId()) + require.Equal(t, "request property 'id/userId' of media-type 'application/json' became required", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing a response property to optional under AllOf, AnyOf or OneOf is breaking +// BC: changing a response property to optional under AllOf, AnyOf or OneOf is breaking: response-property-became-optional func TestBreaking_OneOf(t *testing.T) { s1, err := open("../data/x-of/base.json") require.NoError(t, err) @@ -669,4 +712,13 @@ func TestBreaking_OneOf(t *testing.T) { require.NoError(t, err) errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) require.Len(t, errs, 3) + + require.Equal(t, checker.ResponsePropertyBecameOptionalId, errs[0].GetId()) + require.Equal(t, "property '/allOf[#/components/schemas/ProblemSchema]/changedProperty' became optional for response status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + + require.Equal(t, checker.ResponsePropertyBecameOptionalId, errs[1].GetId()) + require.Equal(t, "property '/anyOf[#/components/schemas/ProblemSchema]/changedProperty' became optional for response status '200'", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) + + require.Equal(t, checker.ResponsePropertyBecameOptionalId, errs[2].GetId()) + require.Equal(t, "property '/oneOf[#/components/schemas/ProblemSchema]/changedProperty' became optional for response status '200'", errs[2].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_breaking_request_type_changed_test.go b/checker/check_breaking_request_type_changed_test.go index dbe3658a..b373498f 100644 --- a/checker/check_breaking_request_type_changed_test.go +++ b/checker/check_breaking_request_type_changed_test.go @@ -9,7 +9,7 @@ import ( "github.com/tufin/oasdiff/diff" ) -// BC: changing request's body schema type from string to number is breaking +// BC: changing request's body schema type from string to number is breaking: request-body-type-changed func TestBreaking_ReqTypeStringToNumber(t *testing.T) { file := "../data/type-change/simple-request.yaml" @@ -26,10 +26,10 @@ func TestBreaking_ReqTypeStringToNumber(t *testing.T) { errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) require.Len(t, errs, 1) require.Equal(t, checker.RequestBodyTypeChangedId, errs[0].GetId()) - require.Equal(t, "the request's body type/format changed from 'string'/'' to 'number'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "type/format of media-type 'application/json' of request body changed from 'string'/'' to 'number'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing request's body schema type from number to string is breaking +// BC: changing request's body schema type from number to string is breaking: request-body-type-changed func TestBreaking_ReqTypeNumberToString(t *testing.T) { file := "../data/type-change/simple-request.yaml" @@ -46,10 +46,10 @@ func TestBreaking_ReqTypeNumberToString(t *testing.T) { errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) require.Len(t, errs, 1) require.Equal(t, checker.RequestBodyTypeChangedId, errs[0].GetId()) - require.Equal(t, "the request's body type/format changed from 'number'/'' to 'string'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "type/format of media-type 'application/json' of request body changed from 'number'/'' to 'string'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing request's body schema type from number to integer is breaking +// BC: changing request's body schema type from number to integer is breaking: request-body-type-changed func TestBreaking_ReqTypeNumberToInteger(t *testing.T) { file := "../data/type-change/simple-request.yaml" @@ -66,10 +66,10 @@ func TestBreaking_ReqTypeNumberToInteger(t *testing.T) { errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) require.Len(t, errs, 1) require.Equal(t, checker.RequestBodyTypeChangedId, errs[0].GetId()) - require.Equal(t, "the request's body type/format changed from 'number'/'' to 'integer'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "type/format of media-type 'application/json' of request body changed from 'number'/'' to 'integer'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing request's body schema type from integer to number is not breaking +// BC: changing request's body schema type from integer to number is not breaking: request-body-type-generalized func TestBreaking_ReqTypeIntegerToNumber(t *testing.T) { file := "../data/type-change/simple-request.yaml" @@ -86,10 +86,10 @@ func TestBreaking_ReqTypeIntegerToNumber(t *testing.T) { errs := checker.CheckBackwardCompatibilityUntilLevel(allChecksConfig(), d, osm, checker.INFO) require.Len(t, errs, 1) require.Equal(t, checker.RequestBodyTypeGeneralizedId, errs[0].GetId()) - require.Equal(t, "the request's body type/format was generalized from 'integer'/'' to 'number'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "type/format of media-type 'application/json' of request body was generalized from 'integer'/'' to 'number'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing request's body schema type from number/none to integer/int32 is breaking +// BC: changing request's body schema type from number/none to integer/int32 is breaking: request-body-type-changed func TestBreaking_ReqTypeNumberToInt32(t *testing.T) { file := "../data/type-change/simple-request.yaml" @@ -107,5 +107,5 @@ func TestBreaking_ReqTypeNumberToInt32(t *testing.T) { errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) require.Len(t, errs, 1) require.Equal(t, checker.RequestBodyTypeChangedId, errs[0].GetId()) - require.Equal(t, "the request's body type/format changed from 'number'/'' to 'integer'/'int32'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "type/format of media-type 'application/json' of request body changed from 'number'/'' to 'integer'/'int32'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_breaking_response_type_changed_test.go b/checker/check_breaking_response_type_changed_test.go index 2c6cb178..a18b2db2 100644 --- a/checker/check_breaking_response_type_changed_test.go +++ b/checker/check_breaking_response_type_changed_test.go @@ -9,7 +9,7 @@ import ( "github.com/tufin/oasdiff/diff" ) -// BC: changing response's body schema type from string to number is breaking +// BC: changing response's body schema type from string to number is breaking: response-body-type-changed func TestBreaking_RespTypeStringToNumber(t *testing.T) { file := "../data/type-change/simple-response.yaml" @@ -26,10 +26,10 @@ func TestBreaking_RespTypeStringToNumber(t *testing.T) { errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) require.Len(t, errs, 1) require.Equal(t, checker.ResponseBodyTypeChangedId, errs[0].GetId()) - require.Equal(t, "the response's body type/format changed from 'string'/'' to 'number'/'' for status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "body type/format changed from 'string'/'' to 'number'/'' for response status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing response's body schema type from number to string is breaking +// BC: changing response's body schema type from number to string is breaking: response-body-type-changed func TestBreaking_RespTypeNumberToString(t *testing.T) { file := "../data/type-change/simple-response.yaml" @@ -46,7 +46,7 @@ func TestBreaking_RespTypeNumberToString(t *testing.T) { errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) require.Len(t, errs, 1) require.Equal(t, checker.ResponseBodyTypeChangedId, errs[0].GetId()) - require.Equal(t, "the response's body type/format changed from 'number'/'' to 'string'/'' for status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "body type/format changed from 'number'/'' to 'string'/'' for response status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: changing response's body schema type from number to integer is not breaking @@ -67,7 +67,7 @@ func TestBreaking_RespTypeNumberToInteger(t *testing.T) { require.Empty(t, errs) } -// BC: changing response's body schema type from integer to number is breaking +// BC: changing response's body schema type from integer to number is breaking: response-body-type-changed func TestBreaking_RespTypeIntegerToNumber(t *testing.T) { file := "../data/type-change/simple-response.yaml" @@ -84,7 +84,7 @@ func TestBreaking_RespTypeIntegerToNumber(t *testing.T) { errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) require.Len(t, errs, 1) require.Equal(t, checker.ResponseBodyTypeChangedId, errs[0].GetId()) - require.Equal(t, "the response's body type/format changed from 'integer'/'' to 'number'/'' for status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "body type/format changed from 'integer'/'' to 'number'/'' for response status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: changing response's body schema type from number/none to integer/int32 is not breaking @@ -106,7 +106,7 @@ func TestBreaking_RespTypeNumberToInt32(t *testing.T) { require.Empty(t, errs) } -// BC: changing response's embedded property schema type from string/none to integer/int32 is breaking +// BC: changing response's embedded property schema type from string/none to integer/int32 is breaking: response-property-type-changed func TestBreaking_RespTypeChanged(t *testing.T) { s1, err := open("../data/type-change/base-response.yaml") require.NoError(t, err) @@ -118,6 +118,6 @@ func TestBreaking_RespTypeChanged(t *testing.T) { require.NoError(t, err) errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) require.Len(t, errs, 1) - require.Equal(t, "response-property-type-changed", errs[0].GetId()) - require.Equal(t, "the '/items/testField' response's property type/format changed from 'string'/'' to 'integer'/'int32' for status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, checker.ResponsePropertyTypeChangedId, errs[0].GetId()) + require.Equal(t, "'/items/testField' response property type/format changed from 'string'/'' to 'integer'/'int32' for status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_breaking_test.go b/checker/check_breaking_test.go index a48dc683..df70125e 100644 --- a/checker/check_breaking_test.go +++ b/checker/check_breaking_test.go @@ -34,7 +34,7 @@ func d(t *testing.T, config *diff.Config, v1, v2 int) checker.Changes { return errs } -// BC: deleting a path is breaking +// BC: deleting a path is breaking: api-path-removed-without-deprecation func TestBreaking_DeletedPath(t *testing.T) { errs := d(t, diff.NewConfig(), 1, 701) require.Len(t, errs, 1) @@ -42,7 +42,7 @@ func TestBreaking_DeletedPath(t *testing.T) { require.Equal(t, "api path removed without deprecation", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: deleting an operation is breaking +// BC: deleting an operation is breaking: api-removed-without-deprecation: api-removed-without-deprecation func TestBreaking_DeletedOp(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -58,7 +58,7 @@ func TestBreaking_DeletedOp(t *testing.T) { require.Equal(t, "api removed without deprecation", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: adding a required request body is breaking +// BC: adding a required request body is breaking: request-body-added-required func TestBreaking_AddingRequiredRequestBody(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -76,7 +76,7 @@ func TestBreaking_AddingRequiredRequestBody(t *testing.T) { require.Equal(t, "added required request body", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing an existing request body from optional to required is breaking +// BC: changing an existing request body from optional to required is breaking: request-body-became-required func TestBreaking_RequestBodyRequiredEnabled(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -98,24 +98,24 @@ func TestBreaking_RequestBodyRequiredEnabled(t *testing.T) { require.Equal(t, "request body became required", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: deleting an enum value is breaking +// BC: deleting an enum value is breaking: request-parameter-enum-value-removed func TestBreaking_DeletedEnum(t *testing.T) { errs := d(t, diff.NewConfig(), 702, 1) 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())) + require.Equal(t, "removed enum value 'removed-value' from the 'path' request parameter 'domain'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: added an enum value to response breaking +// BC: added an enum value to response breaking: response-property-enum-value-added func TestBreaking_AddedResponseEnum(t *testing.T) { errs := d(t, diff.NewConfig(), 703, 704) 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, "added 'QWE' enum value to the 'respenum' response property for 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())) + require.Equal(t, "added 'TER2' enum value to the 'respenum2/respenum3' response property for response status 'default'", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } func deleteParam(op *openapi3.Operation, in string, name string) { @@ -153,7 +153,7 @@ func TestBreaking_PathParamRename(t *testing.T) { require.Empty(t, errs) } -// BC: new required path param is breaking +// BC: new required path param is breaking: new-request-path-parameter func TestBreaking_NewPathParam(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -167,10 +167,10 @@ 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())) + require.Equal(t, "added path request parameter 'project'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: new required header param is breaking +// BC: new required header param is breaking: new-required-request-parameter func TestBreaking_NewRequiredHeaderParam(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -184,10 +184,10 @@ 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())) + require.Equal(t, "added required 'header' request parameter 'network-policies'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing an existing header param from optional to required is breaking +// BC: changing an existing header param from optional to required is breaking: request-parameter-became-required func TestBreaking_HeaderParamRequiredEnabled(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -208,10 +208,10 @@ func TestBreaking_HeaderParamRequiredEnabled(t *testing.T) { Path: "/api/{domain}/{project}/install-command", Source: load.NewSource("../data/openapi-test1.yaml"), }, errs[0]) - require.Equal(t, "the 'header' request parameter 'network-policies' became required", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "'header' request parameter 'network-policies' became required", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: changing an existing response header from required to optional is breaking +// BC: changing an existing response header from required to optional is breaking: response-header-became-optional func TestBreaking_ResponseHeaderParamRequiredDisabled(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -225,10 +225,10 @@ 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())) + require.Equal(t, "header 'X-RateLimit-Limit' became optional for response status 'default'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: removing an existing required response header is breaking as error +// BC: removing an existing required response header is breaking as error: required-response-header-removed func TestBreaking_ResponseHeaderRemoved(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -245,10 +245,10 @@ 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())) + require.Equal(t, "removed mandatory header 'X-RateLimit-Limit' for response status 'default'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: removing an existing response with successful status is breaking +// BC: removing an existing response with successful status is breaking: response-success-status-removed func TestBreaking_ResponseSuccessStatusUpdated(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -264,10 +264,10 @@ 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())) + require.Equal(t, "removed success response status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: removing an existing response with non-successful status is breaking (optional) +// BC: removing an existing response with non-successful status is breaking (optional): response-non-success-status-removed func TestBreaking_ResponseNonSuccessStatusUpdated(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -283,10 +283,10 @@ 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())) + require.Equal(t, "removed non-success response status '400'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: removing/updating an operation id is breaking (optional) +// BC: removing/updating an operation id is breaking (optional): api-operation-id-removed func TestBreaking_OperationIdRemoved(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -304,10 +304,10 @@ func TestBreaking_OperationIdRemoved(t *testing.T) { 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) + verifyNonBreakingChangeIsChangelogEntry(t, d, osm, checker.APIOperationIdRemovedId, "api operation id 'GetSecurityScores' removed and replaced with 'newOperationId'") } -// BC: removing/updating an enum in request body is breaking (optional) +// BC: removing/updating an enum in request body is breaking (optional): request-body-enum-value-removed func TestBreaking_RequestBodyEnumRemoved(t *testing.T) { s1, err := open("../data/enums/request-body-enum.yaml") require.NoError(t, err) @@ -327,10 +327,10 @@ func TestBreaking_RequestBodyEnumRemoved(t *testing.T) { require.Len(t, errs, 3) require.Equal(t, checker.RequestBodyEnumValueRemovedId, errs[0].GetId()) - require.Equal(t, "request body enum value removed 'VALUE_1'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "enum value 'VALUE_1' removed from media-type 'application/json' of request body", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: removing/updating a property enum in response is breaking (optional) +// BC: removing/updating a property enum in response is breaking (optional): response-property-enum-value-removed func TestBreaking_ResponsePropertyEnumRemoved(t *testing.T) { s1 := l(t, 704) s2 := l(t, 703) @@ -345,10 +345,10 @@ 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())) + require.Equal(t, "removed 'QWE' enum value from 'respenum' response property for response status 'default'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: removing/updating a tag is breaking (optional) +// BC: removing/updating a tag is breaking (optional): api-tag-removed func TestBreaking_TagRemoved(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -364,10 +364,10 @@ 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())) + require.Equal(t, "removed api tag 'security'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: removing/updating a media type enum in response (optional) +// BC: removing/updating a media type enum in response (optional): response-mediatype-enum-value-removed func TestBreaking_ResponseMediaTypeEnumRemoved(t *testing.T) { s1, err := open("../data/enums/response-enum.yaml") require.NoError(t, err) @@ -419,7 +419,7 @@ func TestBreaking_ResponseErrorStatusRemoved(t *testing.T) { require.Empty(t, errs) } -// BC: removing an existing optional response header is breaking as warn +// BC: removing an existing optional response header is breaking as warn: optional-response-header-removed func TestBreaking_OptionalResponseHeaderRemoved(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -436,10 +436,10 @@ 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())) + require.Equal(t, "removed optional header 'X-RateLimit-Limit' for response status 'default'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: deleting a media-type from response is breaking +// BC: deleting a media-type from response is breaking: response-media-type-removed func TestBreaking_ResponseDeleteMediaType(t *testing.T) { s1, err := open("../data/response-media-type-base.yaml") require.NoError(t, err) @@ -453,7 +453,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())) + require.Equal(t, "removed media type 'application/json' for response status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: deleting a pattern from a schema is not breaking @@ -470,7 +470,7 @@ func TestBreaking_DeletePatten(t *testing.T) { require.Empty(t, errs) } -// BC: adding a pattern to a schema is breaking +// BC: adding a pattern to a schema is breaking: request-property-pattern-added func TestBreaking_AddPattern(t *testing.T) { s1, err := open("../data/pattern-revision.yaml") require.NoError(t, err) @@ -483,11 +483,11 @@ func TestBreaking_AddPattern(t *testing.T) { errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) 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())) + require.Equal(t, checker.RequestPropertyPatternAddedId, errs[0].GetId()) + require.Equal(t, "added pattern '^[a-z]+$' to the request property 'created' of media-type 'application/json'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: adding a pattern to a schema is breaking for recursive properties +// BC: adding a pattern to a schema is breaking for recursive properties: request-property-pattern-added func TestBreaking_AddPatternRecursive(t *testing.T) { s1, err := open("../data/pattern-revision-recursive.yaml") require.NoError(t, err) @@ -500,11 +500,11 @@ func TestBreaking_AddPatternRecursive(t *testing.T) { errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) 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())) + require.Equal(t, checker.RequestPropertyPatternAddedId, errs[0].GetId()) + require.Equal(t, "added pattern '^[a-z]+$' to the request property 'data/created' of media-type 'application/json'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: modifying a pattern in a schema is breaking +// BC: modifying a pattern in a schema is breaking: request-property-pattern-changed func TestBreaking_ModifyPattern(t *testing.T) { s1, err := open("../data/pattern-base.yaml") require.NoError(t, err) @@ -518,7 +518,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())) + require.Equal(t, "changed pattern of the request property 'created' of media-type 'application/json' from '^[a-z]+$' to '.+'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) require.Equal(t, checker.WARN, errs[0].GetLevel()) } @@ -536,7 +536,7 @@ func TestBreaking_GeneralizedPattern(t *testing.T) { require.Empty(t, errs) } -// BC: modifying a pattern in request parameter is breaking +// BC: modifying a pattern in request parameter is breaking: request-parameter-pattern-removed func TestBreaking_ModifyParameterPattern(t *testing.T) { s1, err := open("../data/pattern-parameter-base.yaml") require.NoError(t, err) @@ -550,7 +550,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())) + require.Equal(t, "changed 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 @@ -567,7 +567,7 @@ func TestBreaking_ModifyPatternToAnyString(t *testing.T) { require.Empty(t, errs) } -// BC: modifying the default value of an optional request parameter is breaking +// BC: modifying the default value of an optional request parameter is breaking: request-parameter-default-value-changed func TestBreaking_ModifyRequiredOptionalParamDefaultValue(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -582,10 +582,10 @@ func TestBreaking_ModifyRequiredOptionalParamDefaultValue(t *testing.T) { errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) require.Len(t, errs, 1) require.Equal(t, checker.RequestParameterDefaultValueChangedId, errs[0].GetId()) - require.Equal(t, "for the 'header' request parameter 'network-policies', default value was changed from 'X' to 'Y'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "for 'header' request parameter 'network-policies', default value was changed from 'X' to 'Y'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: setting the default value of an optional request parameter is breaking +// BC: setting the default value of an optional request parameter is breaking: request-parameter-default-value-added func TestBreaking_SettingOptionalParamDefaultValue(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -600,10 +600,10 @@ func TestBreaking_SettingOptionalParamDefaultValue(t *testing.T) { errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) require.Len(t, errs, 1) require.Equal(t, checker.RequestParameterDefaultValueAddedId, errs[0].GetId()) - require.Equal(t, "for the 'header' request parameter 'network-policies', default value 'Y' was added", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "for 'header' request parameter 'network-policies', default value 'Y' was added", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// BC: removing the default value of an optional request parameter is breaking +// BC: removing the default value of an optional request parameter is breaking: request-parameter-default-value-removed func TestBreaking_RemovingOptionalParamDefaultValue(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -617,8 +617,8 @@ func TestBreaking_RemovingOptionalParamDefaultValue(t *testing.T) { require.NoError(t, err) errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) require.Len(t, errs, 1) - require.Equal(t, "request-parameter-default-value-removed", errs[0].GetId()) - require.Equal(t, "for the 'header' request parameter 'network-policies', default value 'Y' was removed", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, checker.RequestParameterDefaultValueRemovedId, errs[0].GetId()) + require.Equal(t, "for 'header' request parameter 'network-policies', default value 'Y' was removed", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: modifying the default value of a required request parameter is not breaking @@ -640,7 +640,7 @@ func TestBreaking_ModifyRequiredRequiredParamDefaultValue(t *testing.T) { require.Empty(t, errs) } -// BC: removing an schema object from components is breaking (optional) +// BC: removing an schema object from components is breaking (optional): api-schema-removed func TestBreaking_SchemaRemoved(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -660,9 +660,9 @@ func TestBreaking_SchemaRemoved(t *testing.T) { } require.NotEmpty(t, errs) require.Equal(t, checker.APISchemasRemovedId, errs[0].GetId()) - require.Equal(t, "removed the schema 'network-policies'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "removed schema 'network-policies'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) require.Equal(t, checker.APISchemasRemovedId, errs[1].GetId()) - require.Equal(t, "removed the schema 'rules'", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "removed schema 'rules'", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: removing a media type from request body is breaking @@ -678,7 +678,7 @@ func TestBreaking_RequestBodyMediaTypeRemoved(t *testing.T) { errs := checker.CheckBackwardCompatibility(allChecksConfig(), d, osm) require.NotEmpty(t, errs) require.Equal(t, "request-body-media-type-removed", errs[0].GetId()) - require.Equal(t, "removed the media type 'application/json' from the request body", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "removed media type 'application/json' from the request body", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: removing 'anyOf' schema from the request body or request body property is breaking @@ -696,11 +696,11 @@ func TestBreaking_RequestPropertyAnyOfRemoved(t *testing.T) { require.Equal(t, checker.RequestBodyAnyOfRemovedId, errs[0].GetId()) require.Equal(t, checker.ERR, errs[0].GetLevel()) - require.Equal(t, "removed '#/components/schemas/Rabbit' from the request body 'anyOf' list", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "removed '#/components/schemas/Rabbit' from media-type 'application/json' of request body 'anyOf' list", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) require.Equal(t, checker.RequestPropertyAnyOfRemovedId, errs[1].GetId()) require.Equal(t, checker.ERR, errs[1].GetLevel()) - require.Equal(t, "removed '#/components/schemas/Breed3' from the '/anyOf[#/components/schemas/Dog]/breed' request property 'anyOf' list", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "removed '#/components/schemas/Breed3' from '/anyOf[#/components/schemas/Dog]/breed' request property of media-type 'application/json' 'anyOf' list", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: removing 'oneOf' schema from the request body or request body property is breaking @@ -717,11 +717,11 @@ func TestBreaking_RequestPropertyOneOfRemoved(t *testing.T) { require.Len(t, errs, 2) require.Equal(t, checker.RequestBodyOneOfRemovedId, errs[0].GetId()) require.Equal(t, checker.ERR, errs[0].GetLevel()) - require.Equal(t, "removed '#/components/schemas/Rabbit' from the request body 'oneOf' list", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "removed '#/components/schemas/Rabbit' from media-type 'application/json' of request body 'oneOf' list", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) require.Equal(t, checker.RequestPropertyOneOfRemovedId, errs[1].GetId()) require.Equal(t, checker.ERR, errs[1].GetLevel()) - require.Equal(t, "removed '#/components/schemas/Breed3' from the '/oneOf[#/components/schemas/Dog]/breed' request property 'oneOf' list", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "removed '#/components/schemas/Breed3' from '/oneOf[#/components/schemas/Dog]/breed' request property of media-type 'application/json' 'oneOf' list", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: adding 'allOf' subschema to the request body or request body property is breaking @@ -739,11 +739,11 @@ func TestBreaking_RequestPropertyAllOfAdded(t *testing.T) { require.Equal(t, checker.RequestBodyAllOfAddedId, errs[0].GetId()) require.Equal(t, checker.ERR, errs[0].GetLevel()) - require.Equal(t, "added '#/components/schemas/Rabbit' to the request body 'allOf' list", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "added '#/components/schemas/Rabbit' to media-type 'application/json' of request body 'allOf' list", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) require.Equal(t, checker.RequestPropertyAllOfAddedId, errs[1].GetId()) require.Equal(t, checker.ERR, errs[1].GetLevel()) - require.Equal(t, "added '#/components/schemas/Breed3' to the '/allOf[#/components/schemas/Dog]/breed' request property 'allOf' list", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "added '#/components/schemas/Breed3' to '/allOf[#/components/schemas/Dog]/breed' request property of media-type 'application/json' 'allOf' list", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: removing 'allOf' subschema from the request body or request body property is breaking with warn @@ -761,9 +761,9 @@ func TestBreaking_RequestPropertyAllOfRemoved(t *testing.T) { require.Equal(t, checker.RequestBodyAllOfRemovedId, errs[0].GetId()) require.Equal(t, checker.WARN, errs[0].GetLevel()) - require.Equal(t, "removed '#/components/schemas/Rabbit' from the request body 'allOf' list", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "removed '#/components/schemas/Rabbit' from media-type 'application/json' of request body 'allOf' list", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) require.Equal(t, checker.RequestPropertyAllOfRemovedId, errs[1].GetId()) require.Equal(t, checker.WARN, errs[1].GetLevel()) - require.Equal(t, "removed '#/components/schemas/Breed3' from the '/allOf[#/components/schemas/Dog]/breed' request property 'allOf' list", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "removed '#/components/schemas/Breed3' from '/allOf[#/components/schemas/Dog]/breed' request property of media-type 'application/json' 'allOf' list", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_components_security_updated_test.go b/checker/check_components_security_updated_test.go index c6799eb1..4a0d1b37 100644 --- a/checker/check_components_security_updated_test.go +++ b/checker/check_components_security_updated_test.go @@ -8,7 +8,7 @@ import ( "github.com/tufin/oasdiff/diff" ) -// CL: changing security component oauth's url +// CL: changing security component oauth's url: api-security-component-oauth-url-changed func TestComponentSecurityOauthURLUpdated(t *testing.T) { s1, err := open("../data/checker/component_security_updated_base.yaml") require.NoError(t, err) @@ -27,10 +27,10 @@ func TestComponentSecurityOauthURLUpdated(t *testing.T) { Level: checker.INFO, Component: checker.ComponentSecuritySchemes, }, errs[0]) - require.Equal(t, "the component security scheme 'petstore_auth' oauth url changed from 'http://example.org/api/oauth/dialog' to 'http://example.new.org/api/oauth/dialog'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "component security scheme 'petstore_auth' oauth url changed from 'http://example.org/api/oauth/dialog' to 'http://example.new.org/api/oauth/dialog'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: changing security component token url +// CL: changing security component token url: api-security-component-oauth-token-url-changed func TestComponentSecurityOauthTokenUpdated(t *testing.T) { s1, err := open("../data/checker/component_security_updated_base.yaml") require.NoError(t, err) @@ -49,10 +49,10 @@ func TestComponentSecurityOauthTokenUpdated(t *testing.T) { Level: checker.INFO, Component: checker.ComponentSecuritySchemes, }, errs[0]) - require.Equal(t, "the component security scheme 'petstore_auth' oauth token url changed from '' to 'http://example.new.org/api/oauth/dialog'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "component security scheme 'petstore_auth' oauth token url changed from '' to 'http://example.new.org/api/oauth/dialog'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: changing security component type +// CL: changing security component type: api-security-component-type-changed func TestComponentSecurityTypeUpdated(t *testing.T) { s1, err := open("../data/checker/component_security_updated_base.yaml") require.NoError(t, err) @@ -71,10 +71,10 @@ func TestComponentSecurityTypeUpdated(t *testing.T) { Level: checker.INFO, Component: checker.ComponentSecuritySchemes, }, errs[0]) - require.Equal(t, "the component security scheme 'petstore_auth' type changed from 'oauth2' to 'http'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "component security scheme 'petstore_auth' type changed from 'oauth2' to 'http'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: adding a new security component +// CL: adding a new security component: api-security-component-added func TestComponentSecurityAdded(t *testing.T) { s1, err := open("../data/checker/component_security_updated_base.yaml") require.NoError(t, err) @@ -91,10 +91,10 @@ func TestComponentSecurityAdded(t *testing.T) { Level: checker.INFO, Component: checker.ComponentSecuritySchemes, }, errs[0]) - require.Equal(t, "the component security scheme 'BasicAuth' was added", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "component security scheme 'BasicAuth' was added", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: removing a new security component +// CL: removing a new security component: api-security-component-removed func TestComponentSecurityRemoved(t *testing.T) { s1, err := open("../data/checker/component_security_updated_revision.yaml") require.NoError(t, err) @@ -111,10 +111,10 @@ func TestComponentSecurityRemoved(t *testing.T) { Level: checker.INFO, Component: checker.ComponentSecuritySchemes, }, errs[0]) - require.Equal(t, "the component security scheme 'BasicAuth' was removed", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "removed component security scheme 'BasicAuth'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: adding a new oauth security scope +// CL: adding a new oauth security scope: api-security-component-oauth-scope-added func TestComponentSecurityOauthScopeAdded(t *testing.T) { s1, err := open("../data/checker/component_security_updated_base.yaml") require.NoError(t, err) @@ -133,10 +133,10 @@ func TestComponentSecurityOauthScopeAdded(t *testing.T) { Level: checker.INFO, Component: checker.ComponentSecuritySchemes, }, errs[0]) - require.Equal(t, "the component security scheme 'petstore_auth' oauth scope 'admin:pets' was added", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "component security scheme 'petstore_auth' oauth scope 'admin:pets' was added", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: removing a new oauth security scope +// CL: removing a new oauth security scope: api-security-component-oauth-scope-removed func TestComponentSecurityOauthScopeRemoved(t *testing.T) { s1, err := open("../data/checker/component_security_updated_base.yaml") require.NoError(t, err) @@ -151,15 +151,15 @@ func TestComponentSecurityOauthScopeRemoved(t *testing.T) { errs := checker.CheckBackwardCompatibilityUntilLevel(singleCheckConfig(checker.APIComponentsSecurityUpdatedCheck), d, osm, checker.INFO) require.Len(t, errs, 1) require.Equal(t, checker.ComponentChange{ - Id: "api-security-component-oauth-scope-removed", + Id: checker.APIComponentSecurityOauthScopeRemovedId, Args: []any{"petstore_auth", "admin:pets"}, Level: checker.INFO, Component: checker.ComponentSecuritySchemes, }, errs[0]) - require.Equal(t, "the component security scheme 'petstore_auth' oauth scope 'admin:pets' was removed", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "removed component security scheme 'petstore_auth' oauth scope 'admin:pets'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: removing a new oauth security scope +// CL: removing a new oauth security scope: api-security-component-oauth-scope-changed func TestComponentSecurityOauthScopeUpdated(t *testing.T) { s1, err := open("../data/checker/component_security_updated_base.yaml") require.NoError(t, err) @@ -173,10 +173,10 @@ func TestComponentSecurityOauthScopeUpdated(t *testing.T) { errs := checker.CheckBackwardCompatibilityUntilLevel(singleCheckConfig(checker.APIComponentsSecurityUpdatedCheck), d, osm, checker.INFO) require.Len(t, errs, 1) require.Equal(t, checker.ComponentChange{ - Id: "api-security-component-oauth-scope-changed", + Id: checker.APIComponentSecurityOauthScopeUpdatedId, Args: []any{"petstore_auth", "read:pets", "read your pets", "grants access to pets (deprecated)"}, Level: checker.INFO, Component: checker.ComponentSecuritySchemes, }, errs[0]) - require.Equal(t, "the component security scheme 'petstore_auth' oauth scope 'read:pets' was updated from 'read your pets' to 'grants access to pets (deprecated)'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "component security scheme 'petstore_auth' oauth scope 'read:pets' was updated from 'read your pets' to 'grants access to pets (deprecated)'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_new_request_non_path_default_parameter_test.go b/checker/check_new_request_non_path_default_parameter_test.go index ebae2b39..46968c51 100644 --- a/checker/check_new_request_non_path_default_parameter_test.go +++ b/checker/check_new_request_non_path_default_parameter_test.go @@ -9,7 +9,7 @@ import ( "github.com/tufin/oasdiff/load" ) -// BC: new header, query and cookie required request default param is breaking +// BC: new header, query and cookie required request default param is breaking: new-required-request-default-parameter-to-existing-path, new-optional-request-default-parameter-to-existing-path func TestNewRequestNonPathParameter_DetectsNewRequiredPathsAndNewOperations(t *testing.T) { s1, err := open("../data/request_params/base.yaml") require.NoError(t, err) diff --git a/checker/check_new_request_non_path_parameter_test.go b/checker/check_new_request_non_path_parameter_test.go index 1731b3bb..dc86f04b 100644 --- a/checker/check_new_request_non_path_parameter_test.go +++ b/checker/check_new_request_non_path_parameter_test.go @@ -8,7 +8,7 @@ import ( "github.com/tufin/oasdiff/diff" ) -// CL: new header, query and cookie request params +// CL: new header, query and cookie request params: new-optional-request-parameter func TestNewRequestNonPathParameter_DetectsNewPathsAndNewOperations(t *testing.T) { s1, err := open("../data/request_params/base.yaml") require.NoError(t, err) diff --git a/checker/check_not_breaking_test.go b/checker/check_not_breaking_test.go index 69dcacbb..f3248938 100644 --- a/checker/check_not_breaking_test.go +++ b/checker/check_not_breaking_test.go @@ -11,7 +11,7 @@ import ( "github.com/tufin/oasdiff/diff" ) -func verifyNonBreakingChangeIsChangelogEntry(t *testing.T, d *diff.Diff, osm *diff.OperationsSourcesMap, changeId string) { +func verifyNonBreakingChangeIsChangelogEntry(t *testing.T, d *diff.Diff, osm *diff.OperationsSourcesMap, changeId string, text string) { t.Helper() // Check no breaking change is detected @@ -22,6 +22,7 @@ func verifyNonBreakingChangeIsChangelogEntry(t *testing.T, d *diff.Diff, osm *di require.Len(t, errs, 1) require.Equal(t, checker.INFO, errs[0].GetLevel()) require.Equal(t, changeId, errs[0].GetId()) + require.Equal(t, text, errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: no change is not breaking @@ -50,7 +51,7 @@ func TestBreaking_AddingOptionalRequestBody(t *testing.T) { require.Empty(t, errs) } -// CL: changing an existing request body from required to optional +// CL: changing an existing request body from required to optional: request-body-became-optional func TestBreaking_RequestBodyRequiredDisabled(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -65,7 +66,7 @@ func TestBreaking_RequestBodyRequiredDisabled(t *testing.T) { d, osm, err := diff.GetWithOperationsSourcesMap(diff.NewConfig(), s1, s2) require.NoError(t, err) - verifyNonBreakingChangeIsChangelogEntry(t, d, osm, checker.RequestBodyBecameOptionalId) + verifyNonBreakingChangeIsChangelogEntry(t, d, osm, checker.RequestBodyBecameOptionalId, "request body became optional") } // BC: deleting a tag is not breaking @@ -129,7 +130,7 @@ func TestBreaking_NewOptionalHeaderParam(t *testing.T) { require.Empty(t, errs) } -// CL: changing an existing header param to optional +// CL: changing an existing header param to optional: request-parameter-became-optional func TestBreaking_HeaderParamRequiredDisabled(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -139,10 +140,7 @@ func TestBreaking_HeaderParamRequiredDisabled(t *testing.T) { d, osm, err := diff.GetWithOperationsSourcesMap(diff.NewConfig(), s1, s2) require.NoError(t, err) - changes := checker.CheckBackwardCompatibilityUntilLevel(allChecksConfig(), d, osm, checker.INFO) - require.NotEmpty(t, changes) - require.Equal(t, checker.RequestParameterBecomeOptionalId, changes[0].GetId()) - require.Len(t, changes, 1) + verifyNonBreakingChangeIsChangelogEntry(t, d, osm, checker.RequestParameterBecomeOptionalId, "'header' request parameter 'network-policies' became optional") } func deleteResponseHeader(response *openapi3.Response, name string) { @@ -195,7 +193,7 @@ func TestBreaking_ResponseAddMediaType(t *testing.T) { require.Empty(t, errs) } -// CL: deprecating an operation with sunset greater than min +// CL: deprecating an operation with sunset greater than min: endpoint-deprecated func TestBreaking_DeprecatedOperation(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -205,9 +203,7 @@ func TestBreaking_DeprecatedOperation(t *testing.T) { d, osm, err := diff.GetWithOperationsSourcesMap(diff.NewConfig(), s1, s2) require.NoError(t, err) - errs := checker.CheckBackwardCompatibilityUntilLevel(allChecksConfig(), d, osm, checker.INFO) - require.Len(t, errs, 1) - require.Equal(t, errs[0].GetLevel(), checker.INFO) + verifyNonBreakingChangeIsChangelogEntry(t, d, osm, checker.EndpointDeprecatedId, "endpoint deprecated") } // BC: deprecating a parameter is not breaking @@ -263,7 +259,7 @@ func TestBreaking_Servers(t *testing.T) { require.Empty(t, errs) } -// BC: adding a tag is not breaking +// BC: adding a tag is not breaking: api-tag-added func TestBreaking_TagAdded(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -271,10 +267,10 @@ func TestBreaking_TagAdded(t *testing.T) { s2.Spec.Paths.Value(securityScorePath).Get.Tags = append(s2.Spec.Paths.Value(securityScorePath).Get.Tags, "newTag") d, osm, err := diff.GetWithOperationsSourcesMap(diff.NewConfig(), s1, s2) require.NoError(t, err) - verifyNonBreakingChangeIsChangelogEntry(t, d, osm, checker.APITagAddedId) + verifyNonBreakingChangeIsChangelogEntry(t, d, osm, checker.APITagAddedId, "added api tag 'newTag'") } -// BC: adding an operation ID is not breaking +// BC: adding an operation ID is not breaking: api-operation-id-added func TestBreaking_OperationIdAdded(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -283,10 +279,10 @@ func TestBreaking_OperationIdAdded(t *testing.T) { d, osm, err := diff.GetWithOperationsSourcesMap(diff.NewConfig(), s1, s2) require.NoError(t, err) - verifyNonBreakingChangeIsChangelogEntry(t, d, osm, checker.APIOperationIdAddId) + verifyNonBreakingChangeIsChangelogEntry(t, d, osm, checker.APIOperationIdAddId, "api operation id 'GetSecurityScores' was added") } -// BC: adding a required property to response is not breaking +// BC: adding a required property to response is not breaking: response-required-property-added func TestBreaking_RequiredResponsePropertyAdded(t *testing.T) { s1, err := open("../data/checker/response_required_property_added_base.yaml") require.NoError(t, err) @@ -296,5 +292,5 @@ func TestBreaking_RequiredResponsePropertyAdded(t *testing.T) { d, osm, err := diff.GetWithOperationsSourcesMap(diff.NewConfig(), s1, s2) require.NoError(t, err) - verifyNonBreakingChangeIsChangelogEntry(t, d, osm, "response-required-property-added") + verifyNonBreakingChangeIsChangelogEntry(t, d, osm, checker.ResponseRequiredPropertyAddedId, "added required property 'data/new' to response status '200'") } diff --git a/checker/check_request_body_became_enum.go b/checker/check_request_body_became_enum.go index c438187f..7e38f004 100644 --- a/checker/check_request_body_became_enum.go +++ b/checker/check_request_body_became_enum.go @@ -27,7 +27,7 @@ func RequestBodyBecameEnumCheck(diffReport *diff.Diff, operationsSources *diff.O modifiedMediaTypes := operationItem.RequestBodyDiff.ContentDiff.MediaTypeModified - for _, mediaTypeDiff := range modifiedMediaTypes { + for mediaType, mediaTypeDiff := range modifiedMediaTypes { if mediaTypeDiff.SchemaDiff == nil { continue } @@ -37,7 +37,7 @@ func RequestBodyBecameEnumCheck(diffReport *diff.Diff, operationsSources *diff.O result = append(result, NewApiChange( RequestBodyBecameEnumId, config, - nil, + []any{mediaType}, "", operationsSources, operationItem.Revision, diff --git a/checker/check_request_body_enum_deleted.go b/checker/check_request_body_enum_deleted.go index f5734389..0bd8dce5 100644 --- a/checker/check_request_body_enum_deleted.go +++ b/checker/check_request_body_enum_deleted.go @@ -30,7 +30,7 @@ func RequestBodyEnumValueRemovedCheck(diffReport *diff.Diff, operationsSources * mediaTypeChanges := operationItem.RequestBodyDiff.ContentDiff.MediaTypeModified - for _, mediaTypeItem := range mediaTypeChanges { + for mediaType, mediaTypeItem := range mediaTypeChanges { if mediaTypeItem.SchemaDiff == nil { continue } @@ -43,7 +43,7 @@ func RequestBodyEnumValueRemovedCheck(diffReport *diff.Diff, operationsSources * result = append(result, NewApiChange( RequestBodyEnumValueRemovedId, config, - []any{enumVal}, + []any{enumVal, mediaType}, "", operationsSources, operationItem.Revision, diff --git a/checker/check_request_body_mediatype_updated_test.go b/checker/check_request_body_mediatype_updated_test.go index 61c337d9..2a29e4e0 100644 --- a/checker/check_request_body_mediatype_updated_test.go +++ b/checker/check_request_body_mediatype_updated_test.go @@ -9,7 +9,7 @@ import ( "github.com/tufin/oasdiff/load" ) -// CL: adding a new media type to request body +// CL: adding a new media type to request body: request-body-media-type-added func TestRequestBodyMediaTypeAdded(t *testing.T) { s1, err := open("../data/checker/request_body_media_type_updated_base.yaml") require.NoError(t, err) @@ -29,9 +29,10 @@ func TestRequestBodyMediaTypeAdded(t *testing.T) { Source: load.NewSource("../data/checker/request_body_media_type_updated_revision.yaml"), OperationId: "createOneGroup", }, errs[0]) + require.Equal(t, "added media type 'application/json' to the request body", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: removing media type from request body +// CL: removing media type from request body: request-body-media-type-removed func TestRequestBodyMediaTypeRemoved(t *testing.T) { s1, err := open("../data/checker/request_body_media_type_updated_revision.yaml") require.NoError(t, err) @@ -51,4 +52,5 @@ func TestRequestBodyMediaTypeRemoved(t *testing.T) { Source: load.NewSource("../data/checker/request_body_media_type_updated_base.yaml"), OperationId: "createOneGroup", }, errs[0]) + require.Equal(t, "removed media type 'application/json' from the request body", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_request_body_required_value_updated_test.go b/checker/check_request_body_required_value_updated_test.go index 67950e66..70fbbc3a 100644 --- a/checker/check_request_body_required_value_updated_test.go +++ b/checker/check_request_body_required_value_updated_test.go @@ -9,7 +9,7 @@ import ( "github.com/tufin/oasdiff/load" ) -// CL: changing request's body to required is breaking +// CL: changing request's body to required is breaking: request-body-became-required func TestRequestBodyBecameRequired(t *testing.T) { s1, err := open("../data/checker/request_body_became_required_base.yaml") require.NoError(t, err) @@ -30,9 +30,10 @@ func TestRequestBodyBecameRequired(t *testing.T) { Source: load.NewSource("../data/checker/request_body_became_required_base.yaml"), OperationId: "createOneGroup", }, errs[0]) + require.Equal(t, "request body became required", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: changing request's body to optional +// CL: changing request's body to optional: request-body-became-optional func TestRequestBodyBecameOptional(t *testing.T) { s1, err := open("../data/checker/request_body_became_optional_base.yaml") require.NoError(t, err) @@ -53,4 +54,5 @@ func TestRequestBodyBecameOptional(t *testing.T) { Source: load.NewSource("../data/checker/request_body_became_optional_base.yaml"), OperationId: "createOneGroup", }, errs[0]) + require.Equal(t, "request body became optional", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_request_discriminator_updated.go b/checker/check_request_discriminator_updated.go index bd011871..0a8f5b75 100644 --- a/checker/check_request_discriminator_updated.go +++ b/checker/check_request_discriminator_updated.go @@ -50,7 +50,7 @@ func RequestDiscriminatorUpdatedCheck(diffReport *diff.Diff, operationsSources * )) } - for _, mediaTypeDiff := range operationItem.RequestBodyDiff.ContentDiff.MediaTypeModified { + for mediaType, mediaTypeDiff := range operationItem.RequestBodyDiff.ContentDiff.MediaTypeModified { if mediaTypeDiff.SchemaDiff == nil { continue } @@ -58,6 +58,7 @@ func RequestDiscriminatorUpdatedCheck(diffReport *diff.Diff, operationsSources * processDiscriminatorDiffForRequest( mediaTypeDiff.SchemaDiff.DiscriminatorDiff, "", + mediaType, appendResultItem) CheckModifiedPropertiesDiff( @@ -66,6 +67,7 @@ func RequestDiscriminatorUpdatedCheck(diffReport *diff.Diff, operationsSources * processDiscriminatorDiffForRequest( propertyDiff.DiscriminatorDiff, propertyFullName(propertyPath, propertyName), + mediaType, appendResultItem) }) @@ -78,6 +80,7 @@ func RequestDiscriminatorUpdatedCheck(diffReport *diff.Diff, operationsSources * func processDiscriminatorDiffForRequest( discriminatorDiff *diff.DiscriminatorDiff, propertyName string, + mediaType string, appendResultItem func(messageId string, a ...any)) { if discriminatorDiff == nil { @@ -91,17 +94,17 @@ func processDiscriminatorDiffForRequest( if discriminatorDiff.Added { if propertyName == "" { - appendResultItem(messageIdPrefix + "-added") + appendResultItem(messageIdPrefix+"-added", mediaType) } else { - appendResultItem(messageIdPrefix+"-added", propertyName) + appendResultItem(messageIdPrefix+"-added", propertyName, mediaType) } return } if discriminatorDiff.Deleted { if propertyName == "" { - appendResultItem(messageIdPrefix + "-removed") + appendResultItem(messageIdPrefix+"-removed", mediaType) } else { - appendResultItem(messageIdPrefix+"-removed", propertyName) + appendResultItem(messageIdPrefix+"-removed", propertyName, mediaType) } return } @@ -110,12 +113,14 @@ func processDiscriminatorDiffForRequest( if propertyName == "" { appendResultItem(messageIdPrefix+"-property-name-changed", discriminatorDiff.PropertyNameDiff.From, - discriminatorDiff.PropertyNameDiff.To) + discriminatorDiff.PropertyNameDiff.To, + mediaType) } else { appendResultItem(messageIdPrefix+"-property-name-changed", propertyName, discriminatorDiff.PropertyNameDiff.From, - discriminatorDiff.PropertyNameDiff.To) + discriminatorDiff.PropertyNameDiff.To, + mediaType) } } @@ -123,22 +128,26 @@ func processDiscriminatorDiffForRequest( if len(discriminatorDiff.MappingDiff.Added) > 0 { if propertyName == "" { appendResultItem(messageIdPrefix+"-mapping-added", - discriminatorDiff.MappingDiff.Added) + discriminatorDiff.MappingDiff.Added, + mediaType) } else { appendResultItem(messageIdPrefix+"-mapping-added", discriminatorDiff.MappingDiff.Added, - propertyName) + propertyName, + mediaType) } } if len(discriminatorDiff.MappingDiff.Deleted) > 0 { if propertyName == "" { appendResultItem(messageIdPrefix+"-mapping-deleted", - discriminatorDiff.MappingDiff.Deleted) + discriminatorDiff.MappingDiff.Deleted, + mediaType) } else { appendResultItem(messageIdPrefix+"-mapping-deleted", discriminatorDiff.MappingDiff.Deleted, - propertyName) + propertyName, + mediaType) } } @@ -147,13 +156,15 @@ func processDiscriminatorDiffForRequest( appendResultItem(messageIdPrefix+"-mapping-changed", k, v.From, - v.To) + v.To, + mediaType) } else { appendResultItem(messageIdPrefix+"-mapping-changed", k, v.From, v.To, - propertyName) + propertyName, + mediaType) } } diff --git a/checker/check_request_discriminator_updated_test.go b/checker/check_request_discriminator_updated_test.go index c75ac798..dc7276a3 100644 --- a/checker/check_request_discriminator_updated_test.go +++ b/checker/check_request_discriminator_updated_test.go @@ -10,7 +10,7 @@ import ( "github.com/tufin/oasdiff/utils" ) -// CL: adding discriminator to the request body or request body property +// CL: adding discriminator to the request body or request body property: request-body-discriminator-added, request-property-discriminator-added func TestRequestDiscriminatorUpdatedCheckAdded(t *testing.T) { s1, err := open("../data/checker/request_property_discriminator_added_base.yaml") require.NoError(t, err) @@ -23,27 +23,30 @@ func TestRequestDiscriminatorUpdatedCheckAdded(t *testing.T) { require.Len(t, errs, 2) - require.ElementsMatch(t, []checker.ApiChange{ - { - Id: checker.RequestBodyDiscriminatorAddedId, - Level: checker.INFO, - Operation: "POST", - Path: "/pets", - Source: load.NewSource("../data/checker/request_property_discriminator_added_revision.yaml"), - OperationId: "updatePets", - }, - { - Id: checker.RequestPropertyDiscriminatorAddedId, - Args: []any{"/oneOf[#/components/schemas/Dog]/breed"}, - Level: checker.INFO, - Operation: "POST", - Path: "/pets", - Source: load.NewSource("../data/checker/request_property_discriminator_added_revision.yaml"), - OperationId: "updatePets", - }}, errs) + require.Equal(t, checker.ApiChange{ + Id: checker.RequestBodyDiscriminatorAddedId, + Args: []any{"application/json"}, + Level: checker.INFO, + Operation: "POST", + Path: "/pets", + Source: load.NewSource("../data/checker/request_property_discriminator_added_revision.yaml"), + OperationId: "updatePets", + }, errs[0]) + require.Equal(t, "added discriminator to media-type 'application/json' of request body", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + + require.Equal(t, checker.ApiChange{ + Id: checker.RequestPropertyDiscriminatorAddedId, + Args: []any{"/oneOf[#/components/schemas/Dog]/breed", "application/json"}, + Level: checker.INFO, + Operation: "POST", + Path: "/pets", + Source: load.NewSource("../data/checker/request_property_discriminator_added_revision.yaml"), + OperationId: "updatePets", + }, errs[1]) + require.Equal(t, "added discriminator to property '/oneOf[#/components/schemas/Dog]/breed' of media-type 'application/json' of request body", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: removing discriminator from the request body or request body property +// CL: removing discriminator from the request body or request body property: request-body-discriminator-removed, request-property-discriminator-removed func TestRequestDiscriminatorUpdatedCheckRemoved(t *testing.T) { s1, err := open("../data/checker/request_property_discriminator_added_revision.yaml") require.NoError(t, err) @@ -56,24 +59,27 @@ func TestRequestDiscriminatorUpdatedCheckRemoved(t *testing.T) { require.Len(t, errs, 2) - require.ElementsMatch(t, []checker.ApiChange{ - { - Id: checker.RequestBodyDiscriminatorRemovedId, - Level: checker.INFO, - Operation: "POST", - Path: "/pets", - Source: load.NewSource("../data/checker/request_property_discriminator_added_base.yaml"), - OperationId: "updatePets", - }, - { - Id: checker.RequestPropertyDiscriminatorRemovedId, - Args: []any{"/oneOf[#/components/schemas/Dog]/breed"}, - Level: checker.INFO, - Operation: "POST", - Path: "/pets", - Source: load.NewSource("../data/checker/request_property_discriminator_added_base.yaml"), - OperationId: "updatePets", - }}, errs) + require.Equal(t, checker.ApiChange{ + Id: checker.RequestBodyDiscriminatorRemovedId, + Args: []any{"application/json"}, + Level: checker.INFO, + Operation: "POST", + Path: "/pets", + Source: load.NewSource("../data/checker/request_property_discriminator_added_base.yaml"), + OperationId: "updatePets", + }, errs[0]) + require.Equal(t, "removed discriminator from media-type 'application/json' of request body", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + + require.Equal(t, checker.ApiChange{ + Id: checker.RequestPropertyDiscriminatorRemovedId, + Args: []any{"/oneOf[#/components/schemas/Dog]/breed", "application/json"}, + Level: checker.INFO, + Operation: "POST", + Path: "/pets", + Source: load.NewSource("../data/checker/request_property_discriminator_added_base.yaml"), + OperationId: "updatePets", + }, errs[1]) + require.Equal(t, "removed discriminator from property '/oneOf[#/components/schemas/Dog]/breed' of media-type 'application/json' of request body", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: changing discriminator propertyName in the request body or request body property @@ -89,25 +95,27 @@ func TestRequestDiscriminatorUpdatedCheckPropertyNameChanging(t *testing.T) { require.Len(t, errs, 2) - require.ElementsMatch(t, []checker.ApiChange{ - { - Id: checker.RequestBodyDiscriminatorPropertyNameChangedId, - Args: []any{"petType", "petType2"}, - Level: checker.INFO, - Operation: "POST", - Path: "/pets", - Source: load.NewSource("../data/checker/request_property_discriminator_added_property_name_changed.yaml"), - OperationId: "updatePets", - }, - { - Id: checker.RequestPropertyDiscriminatorPropertyNameChangedId, - Args: []any{"/oneOf[#/components/schemas/Dog]/breed", "name", "name2"}, - Level: checker.INFO, - Operation: "POST", - Path: "/pets", - Source: load.NewSource("../data/checker/request_property_discriminator_added_property_name_changed.yaml"), - OperationId: "updatePets", - }}, errs) + require.Equal(t, checker.ApiChange{ + Id: checker.RequestBodyDiscriminatorPropertyNameChangedId, + Args: []any{"petType", "petType2", "application/json"}, + Level: checker.INFO, + Operation: "POST", + Path: "/pets", + Source: load.NewSource("../data/checker/request_property_discriminator_added_property_name_changed.yaml"), + OperationId: "updatePets", + }, errs[0]) + require.Equal(t, "discriminator property name changed from 'petType' to 'petType2' for media-type 'application/json' of request body", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + + require.Equal(t, checker.ApiChange{ + Id: checker.RequestPropertyDiscriminatorPropertyNameChangedId, + Args: []any{"/oneOf[#/components/schemas/Dog]/breed", "name", "name2", "application/json"}, + Level: checker.INFO, + Operation: "POST", + Path: "/pets", + Source: load.NewSource("../data/checker/request_property_discriminator_added_property_name_changed.yaml"), + OperationId: "updatePets", + }, errs[1]) + require.Equal(t, "request discriminator property name changed from '/oneOf[#/components/schemas/Dog]/breed' to 'name' for 'name2' request property of media-type 'application/json'", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: changing discriminator mapping in the request body or request body property diff --git a/checker/check_request_header_property_became_enum.go b/checker/check_request_header_property_became_enum.go index 5551e2c3..18e0796e 100644 --- a/checker/check_request_header_property_became_enum.go +++ b/checker/check_request_header_property_became_enum.go @@ -58,7 +58,7 @@ func RequestHeaderPropertyBecameEnumCheck(diffReport *diff.Diff, operationsSourc result = append(result, NewApiChange( RequestHeaderPropertyBecameEnumId, config, - []any{paramName, propertyFullName(propertyPath, propertyName)}, + []any{propertyFullName(propertyPath, propertyName), paramName}, "", operationsSources, operationItem.Revision, diff --git a/checker/check_request_header_property_became_required.go b/checker/check_request_header_property_became_required.go index d00edbdb..432a71b4 100644 --- a/checker/check_request_header_property_became_required.go +++ b/checker/check_request_header_property_became_required.go @@ -51,7 +51,7 @@ func RequestHeaderPropertyBecameRequiredCheck(diffReport *diff.Diff, operationsS result = append(result, NewApiChange( RequestHeaderPropertyBecameRequiredId, config, - []any{paramName, changedRequiredPropertyName}, + []any{changedRequiredPropertyName, paramName}, "", operationsSources, operationItem.Revision, diff --git a/checker/check_request_parameter_became_enum_test.go b/checker/check_request_parameter_became_enum_test.go index d046c087..3387b762 100644 --- a/checker/check_request_parameter_became_enum_test.go +++ b/checker/check_request_parameter_became_enum_test.go @@ -29,5 +29,5 @@ func TestRequestParameterBecameEnum(t *testing.T) { Source: load.NewSource("../data/checker/request_parameter_became_enum_revision.yaml"), OperationId: "createOneGroup", }, errs[0]) - require.Equal(t, "the 'path' request parameter 'groupId' was restricted to a list of enum values", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "'path' request parameter 'groupId' was restricted to a list of enum values", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_request_parameter_pattern_added_or_changed_test.go b/checker/check_request_parameter_pattern_added_or_changed_test.go index 529da6a3..076ab56e 100644 --- a/checker/check_request_parameter_pattern_added_or_changed_test.go +++ b/checker/check_request_parameter_pattern_added_or_changed_test.go @@ -9,7 +9,7 @@ import ( "github.com/tufin/oasdiff/load" ) -// CL: changing pattern of request parameters +// CL: changing pattern of request parameters: request-parameter-pattern-changed func TestRequestParameterPatternChanged(t *testing.T) { s1, err := open("../data/checker/request_parameter_pattern_added_or_changed_base.yaml") require.NoError(t, err) @@ -30,11 +30,11 @@ func TestRequestParameterPatternChanged(t *testing.T) { Path: "/test", Source: load.NewSource("../data/checker/request_parameter_pattern_added_or_changed_base.yaml"), }, errs[0]) - require.Equal(t, "changed the pattern of the 'query' request parameter 'category' from '^\\w+$' to '^[\\w\\s]+$'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "changed pattern of the 'query' request parameter 'category' from '^\\w+$' to '^[\\w\\s]+$'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) require.Equal(t, "This is a warning because it is difficult to automatically analyze if the new pattern is a superset of the previous pattern (e.g. changed from '[0-9]+' to '[0-9]*')", errs[0].GetComment(checker.NewDefaultLocalizer())) } -// CL: generalizing pattern of request parameters +// CL: generalizing pattern of request parameters: request-parameter-pattern-generalized func TestRequestParameterPatternGeneralized(t *testing.T) { s1, err := open("../data/checker/request_parameter_pattern_added_or_changed_base.yaml") require.NoError(t, err) @@ -54,10 +54,10 @@ func TestRequestParameterPatternGeneralized(t *testing.T) { Path: "/test", Source: load.NewSource("../data/checker/request_parameter_pattern_added_or_changed_base.yaml"), }, errs[0]) - require.Equal(t, "changed the pattern of the 'query' request parameter 'category' from '^\\w+$' to a more general pattern '.*'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "changed pattern of the 'query' request parameter 'category' from '^\\w+$' to a more general pattern '.*'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: adding pattern to request parameters +// CL: adding pattern to request parameters: request-parameter-pattern-added func TestRequestParameterPatternAdded(t *testing.T) { s1, err := open("../data/checker/request_parameter_pattern_added_or_changed_revision.yaml") require.NoError(t, err) @@ -77,10 +77,11 @@ func TestRequestParameterPatternAdded(t *testing.T) { Path: "/test", Source: load.NewSource("../data/checker/request_parameter_pattern_added_or_changed_base.yaml"), }, errs[0]) + require.Equal(t, "added pattern '^\\w+$' to the 'query' request parameter 'category'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) require.Equal(t, "This is a warning because it is difficult to automatically analyze if the new pattern is a superset of the previous pattern (e.g. changed from '[0-9]+' to '[0-9]*')", errs[0].GetComment(checker.NewDefaultLocalizer())) } -// CL: removing pattern from request parameters +// CL: removing pattern from request parameters: request-parameter-pattern-removed func TestRequestParameterPatternRemoved(t *testing.T) { s1, err := open("../data/checker/request_parameter_pattern_added_or_changed_base.yaml") require.NoError(t, err) @@ -99,4 +100,5 @@ func TestRequestParameterPatternRemoved(t *testing.T) { Path: "/test", Source: load.NewSource("../data/checker/request_parameter_pattern_added_or_changed_revision.yaml"), }, errs[0]) + require.Equal(t, "removed pattern '^\\w+$' from the 'query' request parameter 'category'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_request_parameter_required_value_updated_test.go b/checker/check_request_parameter_required_value_updated_test.go index 824cca02..3ad92308 100644 --- a/checker/check_request_parameter_required_value_updated_test.go +++ b/checker/check_request_parameter_required_value_updated_test.go @@ -30,6 +30,7 @@ func TestBreaking_HeaderParamBecameRequired(t *testing.T) { Path: "/api/{domain}/{project}/install-command", Source: load.NewSource("../data/openapi-test1.yaml"), }, errs[0]) + require.Equal(t, "'header' request parameter 'network-policies' became required", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: changing an existing header param from required to optional @@ -52,4 +53,5 @@ func TestBreaking_HeaderParamBecameOptional(t *testing.T) { Path: "/api/{domain}/{project}/install-command", Source: load.NewSource("../data/openapi-test1.yaml"), }, errs[0]) + require.Equal(t, "'header' request parameter 'network-policies' became optional", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_request_parameters_type_changed_test.go b/checker/check_request_parameters_type_changed_test.go index 39c95a2a..727b3f86 100644 --- a/checker/check_request_parameters_type_changed_test.go +++ b/checker/check_request_parameters_type_changed_test.go @@ -33,6 +33,7 @@ func TestRequestPathParamTypeChanged(t *testing.T) { Source: load.NewSource("../data/checker/request_parameter_type_changed_base.yaml"), OperationId: "createOneGroup", }, errs[0]) + require.Equal(t, "for 'path' request parameter 'groupId', type/format was changed from 'string'/'' to 'integer'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: changing request query parameter type @@ -57,6 +58,7 @@ func TestRequestQueryParamTypeChanged(t *testing.T) { Source: load.NewSource("../data/checker/request_parameter_type_changed_base.yaml"), OperationId: "createOneGroup", }, errs[0]) + require.Equal(t, "for 'query' request parameter 'token', type/format was changed from 'string'/'uuid' to 'integer'/'uuid'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: changing request header parameter type @@ -81,6 +83,7 @@ func TestRequestQueryHeaderTypeChanged(t *testing.T) { Source: load.NewSource("../data/checker/request_parameter_type_changed_base.yaml"), OperationId: "createOneGroup", }, errs[0]) + require.Equal(t, "for 'header' request parameter 'X-Request-ID', type/format was changed from 'string'/'uuid' to 'integer'/'uuid'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: changing request path parameter format @@ -105,6 +108,7 @@ func TestRequestPathParamFormatChanged(t *testing.T) { Source: load.NewSource("../data/checker/request_parameter_type_changed_base.yaml"), OperationId: "createOneGroup", }, errs[0]) + require.Equal(t, "for 'path' request parameter 'groupId', type/format was changed from 'string'/'' to 'string'/'uuid'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: changing request query parameter format @@ -129,6 +133,7 @@ func TestRequestQueryParamFormatChanged(t *testing.T) { Source: load.NewSource("../data/checker/request_parameter_type_changed_base.yaml"), OperationId: "createOneGroup", }, errs[0]) + require.Equal(t, "for 'query' request parameter 'token', type/format was changed from 'string'/'uuid' to 'string'/'uri'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: changing request header parameter format @@ -153,6 +158,7 @@ func TestRequestQueryHeaderFormatChanged(t *testing.T) { Source: load.NewSource("../data/checker/request_parameter_type_changed_base.yaml"), OperationId: "createOneGroup", }, errs[0]) + require.Equal(t, "for 'header' request parameter 'X-Request-ID', type/format was changed from 'string'/'uuid' to 'string'/'uri'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: changing request path parameter type by adding "string" @@ -178,6 +184,7 @@ func TestRequestPathParamTypeAddString(t *testing.T) { Source: load.NewSource("../data/checker/request_parameter_type_changed_base.yaml"), OperationId: "createOneGroup", }, errs[0]) + require.Equal(t, "for 'path' request parameter 'groupId', type/format was generalized from 'integer'/'' to 'integer, string'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: changing request path parameter type by replacing "integer" with "number" @@ -203,6 +210,7 @@ func TestRequestPathParamTypeIntegerToNumber(t *testing.T) { Source: load.NewSource("../data/checker/request_parameter_type_changed_base.yaml"), OperationId: "createOneGroup", }, errs[0]) + require.Equal(t, "for 'path' request parameter 'groupId', type/format was generalized from 'integer, string'/'' to 'number, string'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // BC: changing request's query param property type from number to string is breaking @@ -218,7 +226,7 @@ func TestBreaking_ReqQueryParamTypeNumberToString(t *testing.T) { errs := checker.CheckBackwardCompatibilityUntilLevel(singleCheckConfig(checker.RequestParameterTypeChangedCheck), d, osm, checker.INFO) require.Len(t, errs, 1) require.Equal(t, checker.RequestParameterPropertyTypeChangedId, errs[0].GetId()) - require.Equal(t, "for the 'query' request parameter 'filters', the type/format of property 'groupId' was changed from 'number'/'' to 'string'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "for 'query' request parameter 'filters', type/format of property 'groupId' was changed from 'number'/'' to 'string'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) require.Equal(t, checker.WARN, errs[0].GetLevel()) } @@ -235,7 +243,7 @@ func TestBreaking_ReqQueryParamTypeStringToNumber(t *testing.T) { errs := checker.CheckBackwardCompatibilityUntilLevel(singleCheckConfig(checker.RequestParameterTypeChangedCheck), d, osm, checker.INFO) require.Len(t, errs, 1) require.Equal(t, checker.RequestParameterPropertyTypeSpecializedId, errs[0].GetId()) - require.Equal(t, "for the 'query' request parameter 'filters', the type/format of property 'groupId' was specialized from 'string'/'' to 'number'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "for 'query' request parameter 'filters', type/format of property 'groupId' was specialized from 'string'/'' to 'number'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) require.Equal(t, checker.ERR, errs[0].GetLevel()) } @@ -252,6 +260,6 @@ func TestBreaking_ReqQueryParamTypeIntegerToNumber(t *testing.T) { errs := checker.CheckBackwardCompatibilityUntilLevel(singleCheckConfig(checker.RequestParameterTypeChangedCheck), d, osm, checker.INFO) require.Len(t, errs, 1) require.Equal(t, checker.RequestParameterPropertyTypeGeneralizedId, errs[0].GetId()) - require.Equal(t, "for the 'query' request parameter 'filters', the type/format of property 'groupId' was generalized from 'integer'/'' to 'number'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "for 'query' request parameter 'filters', type/format of property 'groupId' was generalized from 'integer'/'' to 'number'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) require.Equal(t, checker.INFO, errs[0].GetLevel()) } diff --git a/checker/check_request_property_all_of_updated.go b/checker/check_request_property_all_of_updated.go index b352078a..2b18c089 100644 --- a/checker/check_request_property_all_of_updated.go +++ b/checker/check_request_property_all_of_updated.go @@ -30,7 +30,7 @@ func RequestPropertyAllOfUpdatedCheck(diffReport *diff.Diff, operationsSources * } modifiedMediaTypes := operationItem.RequestBodyDiff.ContentDiff.MediaTypeModified - for _, mediaTypeDiff := range modifiedMediaTypes { + for mediaType, mediaTypeDiff := range modifiedMediaTypes { if mediaTypeDiff.SchemaDiff == nil { continue } @@ -39,7 +39,7 @@ func RequestPropertyAllOfUpdatedCheck(diffReport *diff.Diff, operationsSources * result = append(result, NewApiChange( RequestBodyAllOfAddedId, config, - []any{mediaTypeDiff.SchemaDiff.AllOfDiff.Added.String()}, + []any{mediaTypeDiff.SchemaDiff.AllOfDiff.Added.String(), mediaType}, "", operationsSources, operationItem.Revision, @@ -52,7 +52,7 @@ func RequestPropertyAllOfUpdatedCheck(diffReport *diff.Diff, operationsSources * result = append(result, NewApiChange( RequestBodyAllOfRemovedId, config, - []any{mediaTypeDiff.SchemaDiff.AllOfDiff.Deleted.String()}, + []any{mediaTypeDiff.SchemaDiff.AllOfDiff.Deleted.String(), mediaType}, "", operationsSources, operationItem.Revision, @@ -74,7 +74,7 @@ func RequestPropertyAllOfUpdatedCheck(diffReport *diff.Diff, operationsSources * result = append(result, NewApiChange( RequestPropertyAllOfAddedId, config, - []any{propertyDiff.AllOfDiff.Added.String(), propName}, + []any{propertyDiff.AllOfDiff.Added.String(), propName, mediaType}, "", operationsSources, operationItem.Revision, @@ -87,7 +87,7 @@ func RequestPropertyAllOfUpdatedCheck(diffReport *diff.Diff, operationsSources * result = append(result, NewApiChange( RequestPropertyAllOfRemovedId, config, - []any{propertyDiff.AllOfDiff.Deleted.String(), propName}, + []any{propertyDiff.AllOfDiff.Deleted.String(), propName, mediaType}, "", operationsSources, operationItem.Revision, diff --git a/checker/check_request_property_all_of_updated_test.go b/checker/check_request_property_all_of_updated_test.go index 6b4d6ae1..ea0c095d 100644 --- a/checker/check_request_property_all_of_updated_test.go +++ b/checker/check_request_property_all_of_updated_test.go @@ -22,25 +22,27 @@ func TestRequestPropertyAllOfAdded(t *testing.T) { require.Len(t, errs, 2) - require.ElementsMatch(t, []checker.ApiChange{ - { - Id: checker.RequestBodyAllOfAddedId, - Args: []any{"#/components/schemas/Rabbit"}, - Level: checker.ERR, - Operation: "POST", - Path: "/pets", - Source: load.NewSource("../data/checker/request_property_all_of_added_revision.yaml"), - OperationId: "updatePets", - }, - { - Id: checker.RequestPropertyAllOfAddedId, - Args: []any{"#/components/schemas/Breed3", "/allOf[#/components/schemas/Dog]/breed"}, - Level: checker.ERR, - Operation: "POST", - Path: "/pets", - Source: load.NewSource("../data/checker/request_property_all_of_added_revision.yaml"), - OperationId: "updatePets", - }}, errs) + require.Equal(t, checker.ApiChange{ + Id: checker.RequestBodyAllOfAddedId, + Args: []any{"#/components/schemas/Rabbit", "application/json"}, + Level: checker.ERR, + Operation: "POST", + Path: "/pets", + Source: load.NewSource("../data/checker/request_property_all_of_added_revision.yaml"), + OperationId: "updatePets", + }, errs[0]) + require.Equal(t, "added '#/components/schemas/Rabbit' to media-type 'application/json' of request body 'allOf' list", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + + require.Equal(t, checker.ApiChange{ + Id: checker.RequestPropertyAllOfAddedId, + Args: []any{"#/components/schemas/Breed3", "/allOf[#/components/schemas/Dog]/breed", "application/json"}, + Level: checker.ERR, + Operation: "POST", + Path: "/pets", + Source: load.NewSource("../data/checker/request_property_all_of_added_revision.yaml"), + OperationId: "updatePets", + }, errs[1]) + require.Equal(t, "added '#/components/schemas/Breed3' to '/allOf[#/components/schemas/Dog]/breed' request property of media-type 'application/json' 'allOf' list", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: removing 'allOf' subschema from the request body or request body property @@ -56,23 +58,25 @@ func TestRequestPropertyAllOfRemoved(t *testing.T) { require.Len(t, errs, 2) - require.ElementsMatch(t, []checker.ApiChange{ - { - Id: checker.RequestBodyAllOfRemovedId, - Args: []any{"#/components/schemas/Rabbit"}, - Level: checker.WARN, - Operation: "POST", - Path: "/pets", - Source: load.NewSource("../data/checker/request_property_all_of_removed_revision.yaml"), - OperationId: "updatePets", - }, - { - Id: checker.RequestPropertyAllOfRemovedId, - Args: []any{"#/components/schemas/Breed3", "/allOf[#/components/schemas/Dog]/breed"}, - Level: checker.WARN, - Operation: "POST", - Path: "/pets", - Source: load.NewSource("../data/checker/request_property_all_of_removed_revision.yaml"), - OperationId: "updatePets", - }}, errs) + require.Equal(t, checker.ApiChange{ + Id: checker.RequestBodyAllOfRemovedId, + Args: []any{"#/components/schemas/Rabbit", "application/json"}, + Level: checker.WARN, + Operation: "POST", + Path: "/pets", + Source: load.NewSource("../data/checker/request_property_all_of_removed_revision.yaml"), + OperationId: "updatePets", + }, errs[0]) + require.Equal(t, "removed '#/components/schemas/Rabbit' from media-type 'application/json' of request body 'allOf' list", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + + require.Equal(t, checker.ApiChange{ + Id: checker.RequestPropertyAllOfRemovedId, + Args: []any{"#/components/schemas/Breed3", "/allOf[#/components/schemas/Dog]/breed", "application/json"}, + Level: checker.WARN, + Operation: "POST", + Path: "/pets", + Source: load.NewSource("../data/checker/request_property_all_of_removed_revision.yaml"), + OperationId: "updatePets", + }, errs[1]) + require.Equal(t, "removed '#/components/schemas/Breed3' from '/allOf[#/components/schemas/Dog]/breed' request property of media-type 'application/json' 'allOf' list", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_request_property_any_of_updated.go b/checker/check_request_property_any_of_updated.go index 3c7a41f3..e0c499eb 100644 --- a/checker/check_request_property_any_of_updated.go +++ b/checker/check_request_property_any_of_updated.go @@ -30,7 +30,7 @@ func RequestPropertyAnyOfUpdatedCheck(diffReport *diff.Diff, operationsSources * } modifiedMediaTypes := operationItem.RequestBodyDiff.ContentDiff.MediaTypeModified - for _, mediaTypeDiff := range modifiedMediaTypes { + for mediaType, mediaTypeDiff := range modifiedMediaTypes { if mediaTypeDiff.SchemaDiff == nil { continue } @@ -39,7 +39,7 @@ func RequestPropertyAnyOfUpdatedCheck(diffReport *diff.Diff, operationsSources * result = append(result, NewApiChange( RequestBodyAnyOfAddedId, config, - []any{mediaTypeDiff.SchemaDiff.AnyOfDiff.Added.String()}, + []any{mediaTypeDiff.SchemaDiff.AnyOfDiff.Added.String(), mediaType}, "", operationsSources, operationItem.Revision, @@ -52,7 +52,7 @@ func RequestPropertyAnyOfUpdatedCheck(diffReport *diff.Diff, operationsSources * result = append(result, NewApiChange( RequestBodyAnyOfRemovedId, config, - []any{mediaTypeDiff.SchemaDiff.AnyOfDiff.Deleted.String()}, + []any{mediaTypeDiff.SchemaDiff.AnyOfDiff.Deleted.String(), mediaType}, "", operationsSources, operationItem.Revision, @@ -74,7 +74,7 @@ func RequestPropertyAnyOfUpdatedCheck(diffReport *diff.Diff, operationsSources * result = append(result, NewApiChange( RequestPropertyAnyOfAddedId, config, - []any{propertyDiff.AnyOfDiff.Added.String(), propName}, + []any{propertyDiff.AnyOfDiff.Added.String(), propName, mediaType}, "", operationsSources, operationItem.Revision, @@ -87,7 +87,7 @@ func RequestPropertyAnyOfUpdatedCheck(diffReport *diff.Diff, operationsSources * result = append(result, NewApiChange( RequestPropertyAnyOfRemovedId, config, - []any{propertyDiff.AnyOfDiff.Deleted.String(), propName}, + []any{propertyDiff.AnyOfDiff.Deleted.String(), propName, mediaType}, "", operationsSources, operationItem.Revision, diff --git a/checker/check_request_property_any_of_updated_test.go b/checker/check_request_property_any_of_updated_test.go index 7d852fec..ce362dd0 100644 --- a/checker/check_request_property_any_of_updated_test.go +++ b/checker/check_request_property_any_of_updated_test.go @@ -22,25 +22,27 @@ func TestRequestPropertyAnyOfAdded(t *testing.T) { require.Len(t, errs, 2) - require.ElementsMatch(t, []checker.ApiChange{ - { - Id: checker.RequestBodyAnyOfAddedId, - Args: []any{"#/components/schemas/Rabbit"}, - Level: checker.INFO, - Operation: "POST", - Path: "/pets", - Source: load.NewSource("../data/checker/request_property_any_of_added_revision.yaml"), - OperationId: "updatePets", - }, - { - Id: checker.RequestPropertyAnyOfAddedId, - Args: []any{"#/components/schemas/Breed3", "/anyOf[#/components/schemas/Dog]/breed"}, - Level: checker.INFO, - Operation: "POST", - Path: "/pets", - Source: load.NewSource("../data/checker/request_property_any_of_added_revision.yaml"), - OperationId: "updatePets", - }}, errs) + require.Equal(t, checker.ApiChange{ + Id: checker.RequestBodyAnyOfAddedId, + Args: []any{"#/components/schemas/Rabbit", "application/json"}, + Level: checker.INFO, + Operation: "POST", + Path: "/pets", + Source: load.NewSource("../data/checker/request_property_any_of_added_revision.yaml"), + OperationId: "updatePets", + }, errs[0]) + require.Equal(t, "added '#/components/schemas/Rabbit' to media-type 'application/json' of request body 'anyOf' list", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + + require.Equal(t, checker.ApiChange{ + Id: checker.RequestPropertyAnyOfAddedId, + Args: []any{"#/components/schemas/Breed3", "/anyOf[#/components/schemas/Dog]/breed", "application/json"}, + Level: checker.INFO, + Operation: "POST", + Path: "/pets", + Source: load.NewSource("../data/checker/request_property_any_of_added_revision.yaml"), + OperationId: "updatePets", + }, errs[1]) + require.Equal(t, "added '#/components/schemas/Breed3' to '/anyOf[#/components/schemas/Dog]/breed' request property of media-type 'application/json' 'anyOf' list", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: removing 'anyOf' schema from the request body or request body property @@ -56,23 +58,25 @@ func TestRequestPropertyAnyOfRemoved(t *testing.T) { require.Len(t, errs, 2) - require.ElementsMatch(t, []checker.ApiChange{ - { - Id: checker.RequestBodyAnyOfRemovedId, - Args: []any{"#/components/schemas/Rabbit"}, - Level: checker.ERR, - Operation: "POST", - Path: "/pets", - Source: load.NewSource("../data/checker/request_property_any_of_removed_revision.yaml"), - OperationId: "updatePets", - }, - { - Id: checker.RequestPropertyAnyOfRemovedId, - Args: []any{"#/components/schemas/Breed3", "/anyOf[#/components/schemas/Dog]/breed"}, - Level: checker.ERR, - Operation: "POST", - Path: "/pets", - Source: load.NewSource("../data/checker/request_property_any_of_removed_revision.yaml"), - OperationId: "updatePets", - }}, errs) + require.Equal(t, checker.ApiChange{ + Id: checker.RequestBodyAnyOfRemovedId, + Args: []any{"#/components/schemas/Rabbit", "application/json"}, + Level: checker.ERR, + Operation: "POST", + Path: "/pets", + Source: load.NewSource("../data/checker/request_property_any_of_removed_revision.yaml"), + OperationId: "updatePets", + }, errs[0]) + require.Equal(t, "removed '#/components/schemas/Rabbit' from media-type 'application/json' of request body 'anyOf' list", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + + require.Equal(t, checker.ApiChange{ + Id: checker.RequestPropertyAnyOfRemovedId, + Args: []any{"#/components/schemas/Breed3", "/anyOf[#/components/schemas/Dog]/breed", "application/json"}, + Level: checker.ERR, + Operation: "POST", + Path: "/pets", + Source: load.NewSource("../data/checker/request_property_any_of_removed_revision.yaml"), + OperationId: "updatePets", + }, errs[1]) + require.Equal(t, "removed '#/components/schemas/Breed3' from '/anyOf[#/components/schemas/Dog]/breed' request property of media-type 'application/json' 'anyOf' list", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_request_property_became_enum.go b/checker/check_request_property_became_enum.go index d866d1d9..66422a12 100644 --- a/checker/check_request_property_became_enum.go +++ b/checker/check_request_property_became_enum.go @@ -25,7 +25,7 @@ func RequestPropertyBecameEnumCheck(diffReport *diff.Diff, operationsSources *di continue } modifiedMediaTypes := operationItem.RequestBodyDiff.ContentDiff.MediaTypeModified - for _, mediaTypeDiff := range modifiedMediaTypes { + for mediaType, mediaTypeDiff := range modifiedMediaTypes { if mediaTypeDiff.SchemaDiff == nil { continue } @@ -41,7 +41,7 @@ func RequestPropertyBecameEnumCheck(diffReport *diff.Diff, operationsSources *di result = append(result, NewApiChange( RequestPropertyBecameEnumId, config, - []any{propertyFullName(propertyPath, propertyName)}, + []any{propertyFullName(propertyPath, propertyName), mediaType}, "", operationsSources, operationItem.Revision, diff --git a/checker/check_request_property_became_not_nuallable.go b/checker/check_request_property_became_not_nuallable.go index 8cbccb7d..03fa1506 100644 --- a/checker/check_request_property_became_not_nuallable.go +++ b/checker/check_request_property_became_not_nuallable.go @@ -28,7 +28,7 @@ func RequestPropertyBecameNotNullableCheck(diffReport *diff.Diff, operationsSour continue } modifiedMediaTypes := operationItem.RequestBodyDiff.ContentDiff.MediaTypeModified - for _, mediaTypeDiff := range modifiedMediaTypes { + for mediaType, mediaTypeDiff := range modifiedMediaTypes { if mediaTypeDiff.SchemaDiff == nil { continue } @@ -73,7 +73,7 @@ func RequestPropertyBecameNotNullableCheck(diffReport *diff.Diff, operationsSour result = append(result, NewApiChange( RequestPropertyBecomeNotNullableId, config, - []any{propName}, + []any{propName, mediaType}, "", operationsSources, operationItem.Revision, @@ -84,7 +84,7 @@ func RequestPropertyBecameNotNullableCheck(diffReport *diff.Diff, operationsSour result = append(result, NewApiChange( RequestPropertyBecomeNullableId, config, - []any{propName}, + []any{propName, mediaType}, "", operationsSources, operationItem.Revision, diff --git a/checker/check_request_property_became_not_nuallable_test.go b/checker/check_request_property_became_not_nuallable_test.go index dbd64069..3c7fad35 100644 --- a/checker/check_request_property_became_not_nuallable_test.go +++ b/checker/check_request_property_became_not_nuallable_test.go @@ -22,7 +22,7 @@ func TestRequestPropertyBecameNotNullable(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyBecomeNotNullableId, - Args: []any{"name"}, + Args: []any{"name", "application/json"}, Level: checker.ERR, Operation: "POST", Path: "/products", @@ -44,7 +44,7 @@ func TestRequestPropertyBecameNullable(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyBecomeNullableId, - Args: []any{"name"}, + Args: []any{"name", "application/json"}, Level: checker.INFO, Operation: "POST", Path: "/products", diff --git a/checker/check_request_property_enum_value_updated.go b/checker/check_request_property_enum_value_updated.go index 09b0b365..1df95ca6 100644 --- a/checker/check_request_property_enum_value_updated.go +++ b/checker/check_request_property_enum_value_updated.go @@ -27,7 +27,7 @@ func RequestPropertyEnumValueUpdatedCheck(diffReport *diff.Diff, operationsSourc } modifiedMediaTypes := operationItem.RequestBodyDiff.ContentDiff.MediaTypeModified - for _, mediaTypeDiff := range modifiedMediaTypes { + for mediaType, mediaTypeDiff := range modifiedMediaTypes { CheckModifiedPropertiesDiff( mediaTypeDiff.SchemaDiff, func(propertyPath string, propertyName string, propertyDiff *diff.SchemaDiff, parent *diff.SchemaDiff) { @@ -48,7 +48,7 @@ func RequestPropertyEnumValueUpdatedCheck(diffReport *diff.Diff, operationsSourc result = append(result, NewApiChange( id, config, - []any{enumVal, propName}, + []any{enumVal, propName, mediaType}, "", operationsSources, operationItem.Revision, @@ -61,7 +61,7 @@ func RequestPropertyEnumValueUpdatedCheck(diffReport *diff.Diff, operationsSourc result = append(result, NewApiChange( RequestPropertyEnumValueAddedId, config, - []any{enumVal, propName}, + []any{enumVal, propName, mediaType}, "", operationsSources, operationItem.Revision, diff --git a/checker/check_request_property_enum_value_updated_test.go b/checker/check_request_property_enum_value_updated_test.go index b84940d4..1dc6a23a 100644 --- a/checker/check_request_property_enum_value_updated_test.go +++ b/checker/check_request_property_enum_value_updated_test.go @@ -27,13 +27,13 @@ func TestRequestPropertyEnumValueRemovedCheck(t *testing.T) { require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyEnumValueRemovedId, Level: checker.ERR, - Args: []any{"bird", "category"}, + Args: []any{"bird", "category", "application/json"}, Operation: "POST", OperationId: "updatePet", Path: "/pets", Source: load.NewSource("../data/checker/request_property_enum_value_updated_base.yaml"), }, errs[0]) - require.Equal(t, "removed the enum value 'bird' of the request property 'category'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "removed enum value 'bird' of request property 'category' of media-type 'application/json'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: removing request read-only property enum values @@ -55,13 +55,13 @@ func TestRequestReadOnlyPropertyEnumValueRemovedCheck(t *testing.T) { require.Equal(t, checker.ApiChange{ Id: checker.RequestReadOnlyPropertyEnumValueRemovedId, Level: checker.INFO, - Args: []any{"bird", "category"}, + Args: []any{"bird", "category", "application/json"}, Operation: "POST", OperationId: "updatePet", Path: "/pets", Source: load.NewSource("../data/checker/request_property_enum_value_updated_base.yaml"), }, errs[0]) - require.Equal(t, "removed the enum value 'bird' of the request read-only property 'category'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "removed enum value 'bird' of request read-only property 'category' of media-type 'application/json'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: adding request property enum values @@ -82,11 +82,11 @@ func TestRequestPropertyEnumValueAddedCheck(t *testing.T) { require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyEnumValueAddedId, Level: checker.INFO, - Args: []any{"bird", "category"}, + Args: []any{"bird", "category", "application/json"}, Operation: "POST", OperationId: "updatePet", Path: "/pets", Source: load.NewSource("../data/checker/request_property_enum_value_updated_base.yaml"), }, errs[0]) - require.Equal(t, "added the new 'bird' enum value to the request property 'category'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "added 'bird' enum value to request property 'category' of media type 'application/json'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_request_property_max_length_updated.go b/checker/check_request_property_max_length_updated.go index 87ecad27..16d111c9 100644 --- a/checker/check_request_property_max_length_updated.go +++ b/checker/check_request_property_max_length_updated.go @@ -29,7 +29,7 @@ func RequestPropertyMaxLengthUpdatedCheck(diffReport *diff.Diff, operationsSourc } modifiedMediaTypes := operationItem.RequestBodyDiff.ContentDiff.MediaTypeModified - for _, mediaTypeDiff := range modifiedMediaTypes { + for mediaType, mediaTypeDiff := range modifiedMediaTypes { if mediaTypeDiff.SchemaDiff != nil && mediaTypeDiff.SchemaDiff.MaxLengthDiff != nil { maxLengthDiff := mediaTypeDiff.SchemaDiff.MaxLengthDiff if maxLengthDiff.From != nil && @@ -38,7 +38,7 @@ func RequestPropertyMaxLengthUpdatedCheck(diffReport *diff.Diff, operationsSourc result = append(result, NewApiChange( RequestBodyMaxLengthDecreasedId, config, - []any{maxLengthDiff.To}, + []any{mediaType, maxLengthDiff.From, maxLengthDiff.To}, "", operationsSources, operationItem.Revision, @@ -49,7 +49,7 @@ func RequestPropertyMaxLengthUpdatedCheck(diffReport *diff.Diff, operationsSourc result = append(result, NewApiChange( RequestBodyMaxLengthIncreasedId, config, - []any{maxLengthDiff.From, maxLengthDiff.To}, + []any{mediaType, maxLengthDiff.From, maxLengthDiff.To}, "", operationsSources, operationItem.Revision, @@ -85,7 +85,7 @@ func RequestPropertyMaxLengthUpdatedCheck(diffReport *diff.Diff, operationsSourc result = append(result, NewApiChange( id, config, - []any{propName, maxLengthDiff.To}, + []any{propName, mediaType, maxLengthDiff.From, maxLengthDiff.To}, "", operationsSources, operationItem.Revision, @@ -96,7 +96,7 @@ func RequestPropertyMaxLengthUpdatedCheck(diffReport *diff.Diff, operationsSourc result = append(result, NewApiChange( RequestPropertyMaxLengthIncreasedId, config, - []any{propName, maxLengthDiff.From, maxLengthDiff.To}, + []any{propName, mediaType, maxLengthDiff.From, maxLengthDiff.To}, "", operationsSources, operationItem.Revision, diff --git a/checker/check_request_property_max_length_updated_test.go b/checker/check_request_property_max_length_updated_test.go index 99f66541..297fda1b 100644 --- a/checker/check_request_property_max_length_updated_test.go +++ b/checker/check_request_property_max_length_updated_test.go @@ -28,13 +28,14 @@ func TestRequestBodyMaxLengthDecreasedCheck(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.RequestBodyMaxLengthIncreasedId, - Args: []any{maxLength, newMaxLength}, + Args: []any{"application/json", maxLength, newMaxLength}, Level: checker.INFO, Operation: "POST", Path: "/pets", Source: load.NewSource("../data/checker/request_body_max_length_decreased_base.yaml"), OperationId: "addPet", }, errs[0]) + require.Equal(t, "maxLength value of media-type 'application/json' of request body was increased from '50' to '100'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: decreasing max length of request body @@ -56,13 +57,14 @@ func TestRequestBodyMaxLengthIncreasedCheck(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.RequestBodyMaxLengthDecreasedId, - Args: []any{newMaxLength}, + Args: []any{"application/json", maxLength, newMaxLength}, Level: checker.ERR, Operation: "POST", Path: "/pets", Source: load.NewSource("../data/checker/request_body_max_length_decreased_base.yaml"), OperationId: "addPet", }, errs[0]) + require.Equal(t, "maxLength value of media-type 'application/json' of request body was decreased from '100' to '50'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: decreasing max length of request property @@ -83,14 +85,14 @@ func TestRequestPropertyMaxLengthDecreasedCheck(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyMaxLengthDecreasedId, - Args: []any{"description", newMaxLength}, + Args: []any{"description", "application/json", maxLength, newMaxLength}, Level: checker.ERR, Operation: "POST", Path: "/pets", Source: load.NewSource("../data/checker/request_body_max_length_decreased_base.yaml"), OperationId: "addPet", }, errs[0]) - require.Equal(t, "the 'description' request property's maxLength was decreased to '50'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "maxLength value of request property 'description' of media-type 'application/json' was decreased from '100' to '50'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: decreasing max length of request read-only property @@ -113,14 +115,14 @@ func TestRequestReadOnlyPropertyMaxLengthDecreasedCheck(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.RequestReadOnlyPropertyMaxLengthDecreasedId, - Args: []any{"description", newMaxLength}, + Args: []any{"description", "application/json", maxLength, newMaxLength}, Level: checker.INFO, Operation: "POST", Path: "/pets", Source: load.NewSource("../data/checker/request_body_max_length_decreased_base.yaml"), OperationId: "addPet", }, errs[0]) - require.Equal(t, "the 'description' request read-only property's maxLength was decreased to '50'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "maxLength value of request read-only property 'description' of media-type 'application/json' was decreased from '100' to '50'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: increasing max length of request property @@ -141,11 +143,12 @@ func TestRequestPropertyMaxLengthIncreasedCheck(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyMaxLengthIncreasedId, - Args: []any{"description", maxLength, newMaxLength}, + Args: []any{"description", "application/json", maxLength, newMaxLength}, Level: checker.INFO, Operation: "POST", Path: "/pets", Source: load.NewSource("../data/checker/request_body_max_length_decreased_base.yaml"), OperationId: "addPet", }, errs[0]) + require.Equal(t, "maxLength value of request property 'description' of media-type 'application/json' was increased from '50' to '100'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_request_property_min_length_updated.go b/checker/check_request_property_min_length_updated.go index edd846aa..6dd15e05 100644 --- a/checker/check_request_property_min_length_updated.go +++ b/checker/check_request_property_min_length_updated.go @@ -28,7 +28,7 @@ func RequestPropertyMinLengthUpdatedCheck(diffReport *diff.Diff, operationsSourc } modifiedMediaTypes := operationItem.RequestBodyDiff.ContentDiff.MediaTypeModified - for _, mediaTypeDiff := range modifiedMediaTypes { + for mediaType, mediaTypeDiff := range modifiedMediaTypes { if mediaTypeDiff.SchemaDiff != nil && mediaTypeDiff.SchemaDiff.MinLengthDiff != nil { minLengthDiff := mediaTypeDiff.SchemaDiff.MinLengthDiff if minLengthDiff.From != nil && @@ -37,7 +37,7 @@ func RequestPropertyMinLengthUpdatedCheck(diffReport *diff.Diff, operationsSourc result = append(result, NewApiChange( RequestBodyMinLengthIncreasedId, config, - []any{minLengthDiff.From, minLengthDiff.To}, + []any{mediaType, minLengthDiff.From, minLengthDiff.To}, "", operationsSources, operationItem.Revision, @@ -48,7 +48,7 @@ func RequestPropertyMinLengthUpdatedCheck(diffReport *diff.Diff, operationsSourc result = append(result, NewApiChange( RequestBodyMinLengthDecreasedId, config, - []any{minLengthDiff.From, minLengthDiff.To}, + []any{mediaType, minLengthDiff.From, minLengthDiff.To}, "", operationsSources, operationItem.Revision, @@ -77,7 +77,7 @@ func RequestPropertyMinLengthUpdatedCheck(diffReport *diff.Diff, operationsSourc result = append(result, NewApiChange( RequestPropertyMinLengthDecreasedId, config, - []any{propName, minLengthDiff.From, minLengthDiff.To}, + []any{propName, mediaType, minLengthDiff.From, minLengthDiff.To}, "", operationsSources, operationItem.Revision, @@ -88,7 +88,7 @@ func RequestPropertyMinLengthUpdatedCheck(diffReport *diff.Diff, operationsSourc result = append(result, NewApiChange( RequestPropertyMinLengthIncreasedId, config, - []any{propName, minLengthDiff.From, minLengthDiff.To}, + []any{propName, mediaType, minLengthDiff.From, minLengthDiff.To}, "", operationsSources, operationItem.Revision, diff --git a/checker/check_request_property_min_length_updated_test.go b/checker/check_request_property_min_length_updated_test.go index ee6ce5bd..49e51cc2 100644 --- a/checker/check_request_property_min_length_updated_test.go +++ b/checker/check_request_property_min_length_updated_test.go @@ -24,13 +24,14 @@ func TestRequestPropertyMinLengthDecreased(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyMinLengthDecreasedId, - Args: []any{"name", uint64(3), uint64(2)}, + Args: []any{"name", "application/json", uint64(3), uint64(2)}, Level: checker.INFO, Operation: "POST", Path: "/products", Source: load.NewSource("../data/checker/request_property_min_length_decreased_base.yaml"), OperationId: "addProduct", }, errs[0]) + require.Equal(t, "minLength value of request property 'name' of media-type 'application/json' was decreased from '3' to '2'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: increasing minLength of request property @@ -48,13 +49,14 @@ func TestRequestPropertyMinLengthIncreased(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyMinLengthIncreasedId, - Args: []any{"name", uint64(3), uint64(5)}, + Args: []any{"name", "application/json", uint64(3), uint64(5)}, Level: checker.ERR, Operation: "POST", Path: "/products", Source: load.NewSource("../data/checker/request_property_min_length_decreased_base.yaml"), OperationId: "addProduct", }, errs[0]) + require.Equal(t, "minLength value of request property 'name' of media-type 'application/json' was increased from '3' to '5'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: increasing minLength of request body @@ -72,13 +74,14 @@ func TestRequestBodyMinLengthIncreased(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.RequestBodyMinLengthIncreasedId, - Args: []any{uint64(10), uint64(100)}, + Args: []any{"application/json", uint64(10), uint64(100)}, Level: checker.ERR, Operation: "POST", Path: "/products", Source: load.NewSource("../data/checker/request_property_min_length_decreased_base.yaml"), OperationId: "addProduct", }, errs[0]) + require.Equal(t, "minLength value of media-type 'application/json' of request body was increased from '10' to '100'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: decreasing minLength of request body @@ -96,11 +99,12 @@ func TestRequestBodyMinLengthDecreased(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.RequestBodyMinLengthDecreasedId, - Args: []any{uint64(10), uint64(1)}, + Args: []any{"application/json", uint64(10), uint64(1)}, Level: checker.INFO, Operation: "POST", Path: "/products", Source: load.NewSource("../data/checker/request_property_min_length_decreased_base.yaml"), OperationId: "addProduct", }, errs[0]) + require.Equal(t, "minLength value of media-type 'application/json' of request body was decreased from '10' to '1'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_request_property_one_of_updated.go b/checker/check_request_property_one_of_updated.go index bcc182d8..b47d6cfd 100644 --- a/checker/check_request_property_one_of_updated.go +++ b/checker/check_request_property_one_of_updated.go @@ -30,7 +30,7 @@ func RequestPropertyOneOfUpdatedCheck(diffReport *diff.Diff, operationsSources * } modifiedMediaTypes := operationItem.RequestBodyDiff.ContentDiff.MediaTypeModified - for _, mediaTypeDiff := range modifiedMediaTypes { + for mediaType, mediaTypeDiff := range modifiedMediaTypes { if mediaTypeDiff.SchemaDiff == nil { continue } @@ -39,7 +39,7 @@ func RequestPropertyOneOfUpdatedCheck(diffReport *diff.Diff, operationsSources * result = append(result, NewApiChange( RequestBodyOneOfAddedId, config, - []any{mediaTypeDiff.SchemaDiff.OneOfDiff.Added.String()}, + []any{mediaTypeDiff.SchemaDiff.OneOfDiff.Added.String(), mediaType}, "", operationsSources, operationItem.Revision, @@ -52,7 +52,7 @@ func RequestPropertyOneOfUpdatedCheck(diffReport *diff.Diff, operationsSources * result = append(result, NewApiChange( RequestBodyOneOfRemovedId, config, - []any{mediaTypeDiff.SchemaDiff.OneOfDiff.Deleted.String()}, + []any{mediaTypeDiff.SchemaDiff.OneOfDiff.Deleted.String(), mediaType}, "", operationsSources, operationItem.Revision, @@ -74,7 +74,7 @@ func RequestPropertyOneOfUpdatedCheck(diffReport *diff.Diff, operationsSources * result = append(result, NewApiChange( RequestPropertyOneOfAddedId, config, - []any{propertyDiff.OneOfDiff.Added.String(), propName}, + []any{propertyDiff.OneOfDiff.Added.String(), propName, mediaType}, "", operationsSources, operationItem.Revision, @@ -87,7 +87,7 @@ func RequestPropertyOneOfUpdatedCheck(diffReport *diff.Diff, operationsSources * result = append(result, NewApiChange( RequestPropertyOneOfRemovedId, config, - []any{propertyDiff.OneOfDiff.Deleted.String(), propName}, + []any{propertyDiff.OneOfDiff.Deleted.String(), propName, mediaType}, "", operationsSources, operationItem.Revision, diff --git a/checker/check_request_property_one_of_updated_test.go b/checker/check_request_property_one_of_updated_test.go index 91bee3f9..66cc01c0 100644 --- a/checker/check_request_property_one_of_updated_test.go +++ b/checker/check_request_property_one_of_updated_test.go @@ -22,25 +22,27 @@ func TestRequestPropertyOneOfAdded(t *testing.T) { require.Len(t, errs, 2) - require.ElementsMatch(t, []checker.ApiChange{ - { - Id: checker.RequestBodyOneOfAddedId, - Args: []any{"#/components/schemas/Rabbit"}, - Level: checker.INFO, - Operation: "POST", - Path: "/pets", - Source: load.NewSource("../data/checker/request_property_one_of_added_revision.yaml"), - OperationId: "updatePets", - }, - { - Id: checker.RequestPropertyOneOfAddedId, - Args: []any{"#/components/schemas/Breed3", "/oneOf[#/components/schemas/Dog]/breed"}, - Level: checker.INFO, - Operation: "POST", - Path: "/pets", - Source: load.NewSource("../data/checker/request_property_one_of_added_revision.yaml"), - OperationId: "updatePets", - }}, errs) + require.Equal(t, checker.ApiChange{ + Id: checker.RequestBodyOneOfAddedId, + Args: []any{"#/components/schemas/Rabbit", "application/json"}, + Level: checker.INFO, + Operation: "POST", + Path: "/pets", + Source: load.NewSource("../data/checker/request_property_one_of_added_revision.yaml"), + OperationId: "updatePets", + }, errs[0]) + require.Equal(t, "added '#/components/schemas/Rabbit' to media-type 'application/json' of request body 'oneOf' list", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + + require.Equal(t, checker.ApiChange{ + Id: checker.RequestPropertyOneOfAddedId, + Args: []any{"#/components/schemas/Breed3", "/oneOf[#/components/schemas/Dog]/breed", "application/json"}, + Level: checker.INFO, + Operation: "POST", + Path: "/pets", + Source: load.NewSource("../data/checker/request_property_one_of_added_revision.yaml"), + OperationId: "updatePets", + }, errs[1]) + require.Equal(t, "added '#/components/schemas/Breed3' to '/oneOf[#/components/schemas/Dog]/breed' request property of media-type 'application/json' 'oneOf' list", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: removing 'oneOf' schema from the request body or request body property @@ -56,23 +58,25 @@ func TestRequestPropertyOneOfRemoved(t *testing.T) { require.Len(t, errs, 2) - require.ElementsMatch(t, []checker.ApiChange{ - { - Id: checker.RequestBodyOneOfRemovedId, - Args: []any{"#/components/schemas/Rabbit"}, - Level: checker.ERR, - Operation: "POST", - Path: "/pets", - Source: load.NewSource("../data/checker/request_property_one_of_removed_revision.yaml"), - OperationId: "updatePets", - }, - { - Id: checker.RequestPropertyOneOfRemovedId, - Args: []any{"#/components/schemas/Breed3", "/oneOf[#/components/schemas/Dog]/breed"}, - Level: checker.ERR, - Operation: "POST", - Path: "/pets", - Source: load.NewSource("../data/checker/request_property_one_of_removed_revision.yaml"), - OperationId: "updatePets", - }}, errs) + require.Equal(t, checker.ApiChange{ + Id: checker.RequestBodyOneOfRemovedId, + Args: []any{"#/components/schemas/Rabbit", "application/json"}, + Level: checker.ERR, + Operation: "POST", + Path: "/pets", + Source: load.NewSource("../data/checker/request_property_one_of_removed_revision.yaml"), + OperationId: "updatePets", + }, errs[0]) + require.Equal(t, "removed '#/components/schemas/Rabbit' from media-type 'application/json' of request body 'oneOf' list", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + + require.Equal(t, checker.ApiChange{ + Id: checker.RequestPropertyOneOfRemovedId, + Args: []any{"#/components/schemas/Breed3", "/oneOf[#/components/schemas/Dog]/breed", "application/json"}, + Level: checker.ERR, + Operation: "POST", + Path: "/pets", + Source: load.NewSource("../data/checker/request_property_one_of_removed_revision.yaml"), + OperationId: "updatePets", + }, errs[1]) + require.Equal(t, "removed '#/components/schemas/Breed3' from '/oneOf[#/components/schemas/Dog]/breed' request property of media-type 'application/json' 'oneOf' list", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_request_property_pattern_added_or_changed.go b/checker/check_request_property_pattern_added_or_changed.go index 3ac2396b..c6336b5e 100644 --- a/checker/check_request_property_pattern_added_or_changed.go +++ b/checker/check_request_property_pattern_added_or_changed.go @@ -27,7 +27,7 @@ func RequestPropertyPatternUpdatedCheck(diffReport *diff.Diff, operationsSources continue } modifiedMediaTypes := operationItem.RequestBodyDiff.ContentDiff.MediaTypeModified - for _, mediaTypeDiff := range modifiedMediaTypes { + for mediaType, mediaTypeDiff := range modifiedMediaTypes { CheckModifiedPropertiesDiff( mediaTypeDiff.SchemaDiff, func(propertyPath string, propertyName string, propertyDiff *diff.SchemaDiff, parent *diff.SchemaDiff) { @@ -42,7 +42,7 @@ func RequestPropertyPatternUpdatedCheck(diffReport *diff.Diff, operationsSources result = append(result, NewApiChange( RequestPropertyPatternRemovedId, config, - []any{patternDiff.From, propName}, + []any{patternDiff.From, propName, mediaType}, "", operationsSources, operationItem.Revision, @@ -53,7 +53,7 @@ func RequestPropertyPatternUpdatedCheck(diffReport *diff.Diff, operationsSources result = append(result, NewApiChange( RequestPropertyPatternAddedId, config, - []any{patternDiff.To, propName}, + []any{patternDiff.To, propName, mediaType}, PatternChangedCommentId, operationsSources, operationItem.Revision, @@ -73,7 +73,7 @@ func RequestPropertyPatternUpdatedCheck(diffReport *diff.Diff, operationsSources result = append(result, NewApiChange( id, config, - []any{propName, patternDiff.From, patternDiff.To}, + []any{propName, mediaType, patternDiff.From, patternDiff.To}, comment, operationsSources, operationItem.Revision, diff --git a/checker/check_request_property_pattern_added_or_changed_test.go b/checker/check_request_property_pattern_added_or_changed_test.go index 81bffa65..ba545377 100644 --- a/checker/check_request_property_pattern_added_or_changed_test.go +++ b/checker/check_request_property_pattern_added_or_changed_test.go @@ -9,7 +9,7 @@ import ( "github.com/tufin/oasdiff/load" ) -// CL: changing request property pattern +// CL: changing request property pattern: request-property-pattern-changed func TestRequestPropertyPatternChanged(t *testing.T) { s1, err := open("../data/checker/request_property_pattern_added_or_changed_base.yaml") require.NoError(t, err) @@ -24,17 +24,18 @@ func TestRequestPropertyPatternChanged(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyPatternChangedId, - Args: []any{"name", "^\\w+$", "^[\\w\\s]+$"}, + Args: []any{"name", "application/json", "^\\w+$", "^[\\w\\s]+$"}, Level: checker.WARN, Operation: "POST", Path: "/test", Source: load.NewSource("../data/checker/request_property_pattern_added_or_changed_revision.yaml"), Comment: checker.PatternChangedCommentId, }, errs[0]) + require.Equal(t, "changed pattern of the request property 'name' of media-type 'application/json' from '^\\w+$' to '^[\\w\\s]+$'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) require.Equal(t, "This is a warning because it is difficult to automatically analyze if the new pattern is a superset of the previous pattern (e.g. changed from '[0-9]+' to '[0-9]*')", errs[0].GetComment(checker.NewDefaultLocalizer())) } -// CL: generalizing request property pattern +// CL: generalizing request property pattern: request-property-pattern-generalized func TestRequestPropertyPatternGeneralized(t *testing.T) { s1, err := open("../data/checker/request_property_pattern_added_or_changed_base.yaml") require.NoError(t, err) @@ -49,15 +50,16 @@ func TestRequestPropertyPatternGeneralized(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyPatternGeneralizedId, - Args: []any{"name", "^\\w+$", ".*"}, + Args: []any{"name", "application/json", "^\\w+$", ".*"}, Level: checker.INFO, Operation: "POST", Path: "/test", Source: load.NewSource("../data/checker/request_property_pattern_added_or_changed_revision.yaml"), }, errs[0]) + require.Equal(t, "changed pattern of the request property 'name' of media-type 'application/json' from '^\\w+$' to a more general pattern '.*'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: adding request property pattern +// CL: adding request property pattern: request-property-pattern-added func TestRequestPropertyPatternAdded(t *testing.T) { s1, err := open("../data/checker/request_property_pattern_added_or_changed_revision.yaml") require.NoError(t, err) @@ -70,7 +72,7 @@ func TestRequestPropertyPatternAdded(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyPatternAddedId, - Args: []any{"^\\w+$", "name"}, + Args: []any{"^\\w+$", "name", "application/json"}, Level: checker.WARN, Operation: "POST", Path: "/test", @@ -78,9 +80,10 @@ func TestRequestPropertyPatternAdded(t *testing.T) { Comment: checker.PatternChangedCommentId, }, errs[0]) require.Equal(t, "This is a warning because it is difficult to automatically analyze if the new pattern is a superset of the previous pattern (e.g. changed from '[0-9]+' to '[0-9]*')", errs[0].GetComment(checker.NewDefaultLocalizer())) + require.Equal(t, "added pattern '^\\w+$' to the request property 'name' of media-type 'application/json'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: removing request property pattern +// CL: removing request property pattern: request-property-pattern-removed func TestRequestPropertyPatternRemoved(t *testing.T) { s1, err := open("../data/checker/request_property_pattern_added_or_changed_base.yaml") require.NoError(t, err) @@ -93,10 +96,11 @@ func TestRequestPropertyPatternRemoved(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyPatternRemovedId, - Args: []any{"^\\w+$", "name"}, + Args: []any{"^\\w+$", "name", "application/json"}, Level: checker.INFO, Operation: "POST", Path: "/test", Source: load.NewSource("../data/checker/request_property_pattern_added_or_changed_revision.yaml"), }, errs[0]) + require.Equal(t, "removed pattern '^\\w+$' from the request property 'name' of media-type 'application/json'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_request_property_required_updated.go b/checker/check_request_property_required_updated.go index ebf7fdb2..d191e1e5 100644 --- a/checker/check_request_property_required_updated.go +++ b/checker/check_request_property_required_updated.go @@ -27,7 +27,7 @@ func RequestPropertyRequiredUpdatedCheck(diffReport *diff.Diff, operationsSource continue } modifiedMediaTypes := operationItem.RequestBodyDiff.ContentDiff.MediaTypeModified - for _, mediaTypeDiff := range modifiedMediaTypes { + for mediaType, mediaTypeDiff := range modifiedMediaTypes { if mediaTypeDiff.SchemaDiff == nil { continue } @@ -43,7 +43,7 @@ func RequestPropertyRequiredUpdatedCheck(diffReport *diff.Diff, operationsSource result = append(result, NewApiChange( RequestPropertyBecameRequiredId, config, - []any{propertyFullName(propertyPath, propertyFullName(propertyName, changedRequiredPropertyName))}, + []any{propertyFullName(propertyPath, propertyFullName(propertyName, changedRequiredPropertyName)), mediaType}, "", operationsSources, operationItem.Revision, @@ -55,7 +55,7 @@ func RequestPropertyRequiredUpdatedCheck(diffReport *diff.Diff, operationsSource result = append(result, NewApiChange( RequestPropertyBecameRequiredWithDefaultId, config, - []any{propertyFullName(propertyPath, propertyFullName(propertyName, changedRequiredPropertyName))}, + []any{propertyFullName(propertyPath, propertyFullName(propertyName, changedRequiredPropertyName)), mediaType}, "", operationsSources, operationItem.Revision, @@ -72,7 +72,7 @@ func RequestPropertyRequiredUpdatedCheck(diffReport *diff.Diff, operationsSource result = append(result, NewApiChange( RequestPropertyBecameOptionalId, config, - []any{propertyFullName(propertyPath, propertyFullName(propertyName, changedRequiredPropertyName))}, + []any{propertyFullName(propertyPath, propertyFullName(propertyName, changedRequiredPropertyName)), mediaType}, "", operationsSources, operationItem.Revision, diff --git a/checker/check_request_property_required_updated_test.go b/checker/check_request_property_required_updated_test.go index 72d121f6..3dba2766 100644 --- a/checker/check_request_property_required_updated_test.go +++ b/checker/check_request_property_required_updated_test.go @@ -23,13 +23,14 @@ func TestRequestPropertyMarkedRequired(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyBecameRequiredId, - Args: []any{"name"}, + Args: []any{"name", "application/json"}, Level: checker.ERR, Operation: "POST", Path: "/products", Source: load.NewSource("../data/checker/request_property_became_required_base.yaml"), OperationId: "addProduct", }, errs[0]) + require.Equal(t, "request property 'name' of media-type 'application/json' became required", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: changing request property required value to false @@ -46,13 +47,14 @@ func TestRequestPropertyMarkedOptional(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyBecameOptionalId, - Args: []any{"name"}, + Args: []any{"name", "application/json"}, Level: checker.INFO, Operation: "POST", Path: "/products", Source: load.NewSource("../data/checker/request_property_became_required_base.yaml"), OperationId: "addProduct", }, errs[0]) + require.Equal(t, "request property 'name' of media-type 'application/json' became optional", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: making request property required, while also giving it a default value @@ -70,11 +72,12 @@ func TestRequestPropertyWithDefaultMarkedRequired(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyBecameRequiredWithDefaultId, - Args: []any{"name"}, + Args: []any{"name", "application/json"}, Level: checker.INFO, Operation: "POST", Path: "/products", Source: load.NewSource("../data/checker/request_property_became_required_base.yaml"), OperationId: "addProduct", }, errs[0]) + require.Equal(t, "request property 'name' with a default value became required in media-type 'application/json'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_request_property_type_changed.go b/checker/check_request_property_type_changed.go index ed41fc9f..3434bbe3 100644 --- a/checker/check_request_property_type_changed.go +++ b/checker/check_request_property_type_changed.go @@ -48,7 +48,7 @@ func RequestPropertyTypeChangedCheck(diffReport *diff.Diff, operationsSources *d result = append(result, NewApiChange( id, config, - []any{getBaseType(schemaDiff), getBaseFormat(schemaDiff), getRevisionType(schemaDiff), getRevisionFormat(schemaDiff)}, + []any{mediaType, getBaseType(schemaDiff), getBaseFormat(schemaDiff), getRevisionType(schemaDiff), getRevisionFormat(schemaDiff)}, "", operationsSources, operationItem.Revision, @@ -81,7 +81,7 @@ func RequestPropertyTypeChangedCheck(diffReport *diff.Diff, operationsSources *d result = append(result, NewApiChange( id, config, - []any{propertyFullName(propertyPath, propertyName), getBaseType(schemaDiff), getBaseFormat(schemaDiff), getRevisionType(schemaDiff), getRevisionFormat(schemaDiff)}, + []any{propertyFullName(propertyPath, propertyName), mediaType, getBaseType(schemaDiff), getBaseFormat(schemaDiff), getRevisionType(schemaDiff), getRevisionFormat(schemaDiff)}, "", operationsSources, operationItem.Revision, diff --git a/checker/check_request_property_type_changed_test.go b/checker/check_request_property_type_changed_test.go index 825b99db..ce7e2358 100644 --- a/checker/check_request_property_type_changed_test.go +++ b/checker/check_request_property_type_changed_test.go @@ -28,12 +28,13 @@ func TestRequestBodyTypeChangedCheck(t *testing.T) { require.Equal(t, checker.ApiChange{ Id: checker.RequestBodyTypeChangedId, Level: checker.ERR, - Args: []any{utils.StringList{"object"}, "", utils.StringList{"array"}, ""}, + Args: []any{"application/json", utils.StringList{"object"}, "", utils.StringList{"array"}, ""}, Operation: "POST", Path: "/pets", Source: load.NewSource("../data/checker/request_property_type_changed_base.yaml"), OperationId: "addPet", }, errs[0]) + require.Equal(t, "type/format of media-type 'application/json' of request body changed from 'object'/'' to 'array'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: changing request body type @@ -53,12 +54,13 @@ func TestRequestBodyFormatChangedCheck(t *testing.T) { require.Equal(t, checker.ApiChange{ Id: checker.RequestBodyTypeChangedId, Level: checker.ERR, - Args: []any{utils.StringList{"object"}, "", utils.StringList{"object"}, "uuid"}, + Args: []any{"application/json", utils.StringList{"object"}, "", utils.StringList{"object"}, "uuid"}, Operation: "POST", Path: "/pets", Source: load.NewSource("../data/checker/request_property_type_changed_base.yaml"), OperationId: "addPet", }, errs[0]) + require.Equal(t, "type/format of media-type 'application/json' of request body changed from 'object'/'' to 'object'/'uuid'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: changing request property type @@ -76,12 +78,13 @@ func TestRequestPropertyTypeChangedCheck(t *testing.T) { require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyTypeChangedId, Level: checker.ERR, - Args: []any{"age", utils.StringList{"integer"}, "int32", utils.StringList{"string"}, "string"}, + Args: []any{"age", "application/json", utils.StringList{"integer"}, "int32", utils.StringList{"string"}, "string"}, Operation: "POST", Path: "/pets", Source: load.NewSource("../data/checker/request_property_type_changed_revision.yaml"), OperationId: "addPet", }, errs[0]) + require.Equal(t, "type/format of request property 'age' of media-type 'application/json' changed from 'integer'/'int32' to 'string'/'string'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: changing request body and property types from array to object @@ -99,21 +102,24 @@ func TestRequestBodyAndPropertyTypesChangedCheckArrayToObject(t *testing.T) { require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyTypeChangedId, Level: checker.ERR, - Args: []any{"colors", utils.StringList{"array"}, "", utils.StringList{"object"}, ""}, + Args: []any{"colors", "application/json", utils.StringList{"array"}, "", utils.StringList{"object"}, ""}, Operation: "POST", Path: "/dogs", Source: load.NewSource("../data/checker/request_property_type_changed_revision_array_to_object.yaml"), OperationId: "addDog", }, errs[0]) + require.Equal(t, "type/format of request property 'colors' of media-type 'application/json' changed from 'array'/'' to 'object'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, checker.ApiChange{ Id: checker.RequestBodyTypeChangedId, Level: checker.ERR, - Args: []any{utils.StringList{"array"}, "", utils.StringList{"object"}, ""}, + Args: []any{"application/json", utils.StringList{"array"}, "", utils.StringList{"object"}, ""}, Operation: "POST", Path: "/pets", Source: load.NewSource("../data/checker/request_property_type_changed_revision_array_to_object.yaml"), OperationId: "addPet", }, errs[1]) + require.Equal(t, "type/format of media-type 'application/json' of request body changed from 'array'/'' to 'object'/''", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: changing request body and property types from object to array @@ -131,21 +137,24 @@ func TestRequestBodyAndPropertyTypesChangedCheckObjectToArray(t *testing.T) { require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyTypeChangedId, Level: checker.ERR, - Args: []any{"colors", utils.StringList{"object"}, "", utils.StringList{"array"}, ""}, + Args: []any{"colors", "application/json", utils.StringList{"object"}, "", utils.StringList{"array"}, ""}, Operation: "POST", Path: "/dogs", Source: load.NewSource("../data/checker/request_property_type_changed_base_array_to_object.yaml"), OperationId: "addDog", }, errs[0]) + require.Equal(t, "type/format of request property 'colors' of media-type 'application/json' changed from 'object'/'' to 'array'/''", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, checker.ApiChange{ Id: checker.RequestBodyTypeChangedId, Level: checker.ERR, - Args: []any{utils.StringList{"object"}, "", utils.StringList{"array"}, ""}, + Args: []any{"application/json", utils.StringList{"object"}, "", utils.StringList{"array"}, ""}, Operation: "POST", Path: "/pets", Source: load.NewSource("../data/checker/request_property_type_changed_base_array_to_object.yaml"), OperationId: "addPet", }, errs[1]) + require.Equal(t, "type/format of media-type 'application/json' of request body changed from 'object'/'' to 'array'/''", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: changing request property format @@ -165,12 +174,13 @@ func TestRequestPropertyFormatChangedCheck(t *testing.T) { require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyTypeChangedId, Level: checker.ERR, - Args: []any{"age", utils.StringList{"integer"}, "int32", utils.StringList{"integer"}, "uuid"}, + Args: []any{"age", "application/json", utils.StringList{"integer"}, "int32", utils.StringList{"integer"}, "uuid"}, Operation: "POST", Path: "/pets", Source: load.NewSource("../data/checker/request_property_type_changed_base.yaml"), OperationId: "addPet", }, errs[0]) + require.Equal(t, "type/format of request property 'age' of media-type 'application/json' changed from 'integer'/'int32' to 'integer'/'uuid'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: generalizing request property format @@ -191,10 +201,11 @@ func TestRequestPropertyFormatChangedCheckNonBreaking(t *testing.T) { require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyTypeGeneralizedId, Level: checker.INFO, - Args: []any{"age", utils.StringList{"integer"}, "int32", utils.StringList{"number"}, "int32"}, + Args: []any{"age", "application/json", utils.StringList{"integer"}, "int32", utils.StringList{"number"}, "int32"}, Operation: "POST", Path: "/pets", Source: load.NewSource("../data/checker/request_property_type_changed_base.yaml"), OperationId: "addPet", }, errs[0]) + require.Equal(t, "type/format of request property 'age' of media-type 'application/json' was generalized from 'integer'/'int32' to 'number'/'int32'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_request_property_updated.go b/checker/check_request_property_updated.go index 73f6f27e..351adc6e 100644 --- a/checker/check_request_property_updated.go +++ b/checker/check_request_property_updated.go @@ -29,7 +29,7 @@ func RequestPropertyUpdatedCheck(diffReport *diff.Diff, operationsSources *diff. continue } modifiedMediaTypes := operationItem.RequestBodyDiff.ContentDiff.MediaTypeModified - for _, mediaTypeDiff := range modifiedMediaTypes { + for mediaType, mediaTypeDiff := range modifiedMediaTypes { CheckDeletedPropertiesDiff( mediaTypeDiff.SchemaDiff, func(propertyPath string, propertyName string, propertyItem *openapi3.Schema, parent *diff.SchemaDiff) { @@ -38,7 +38,7 @@ func RequestPropertyUpdatedCheck(diffReport *diff.Diff, operationsSources *diff. result = append(result, NewApiChange( RequestPropertyRemovedId, config, - []any{propertyFullName(propertyPath, propertyName)}, + []any{propertyFullName(propertyPath, propertyName), mediaType}, "", operationsSources, operationItem.Revision, @@ -61,7 +61,7 @@ func RequestPropertyUpdatedCheck(diffReport *diff.Diff, operationsSources *diff. result = append(result, NewApiChange( NewRequiredRequestPropertyId, config, - []any{propName}, + []any{propName, mediaType}, "", operationsSources, operationItem.Revision, @@ -72,7 +72,7 @@ func RequestPropertyUpdatedCheck(diffReport *diff.Diff, operationsSources *diff. result = append(result, NewApiChange( NewRequiredRequestPropertyWithDefaultId, config, - []any{propName}, + []any{propName, mediaType}, "", operationsSources, operationItem.Revision, @@ -84,7 +84,7 @@ func RequestPropertyUpdatedCheck(diffReport *diff.Diff, operationsSources *diff. result = append(result, NewApiChange( NewOptionalRequestPropertyId, config, - []any{propName}, + []any{propName, mediaType}, "", operationsSources, operationItem.Revision, diff --git a/checker/check_request_property_updated_test.go b/checker/check_request_property_updated_test.go index d5f42b3e..42ff42c4 100644 --- a/checker/check_request_property_updated_test.go +++ b/checker/check_request_property_updated_test.go @@ -22,16 +22,17 @@ func TestRequiredRequestPropertyAdded(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.NewRequiredRequestPropertyId, - Args: []any{"description"}, + Args: []any{"description", "application/json"}, Level: checker.ERR, Operation: "POST", Path: "/products", Source: load.NewSource("../data/checker/request_property_added_revision.yaml"), OperationId: "addProduct", }, errs[0]) + require.Equal(t, "added required request property 'description' to media-type 'application/json'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: adding two new request properties, one required, one optional +// CL: adding two new request properties, one required, one optional: new-required-request-property, new-optional-request-property func TestRequiredRequestPropertiesAdded(t *testing.T) { s1, err := open("../data/checker/request_property_added_base.yaml") require.NoError(t, err) @@ -41,25 +42,29 @@ func TestRequiredRequestPropertiesAdded(t *testing.T) { d, osm, err := diff.GetWithOperationsSourcesMap(diff.NewConfig(), s1, s2) require.NoError(t, err) errs := checker.CheckBackwardCompatibilityUntilLevel(singleCheckConfig(checker.RequestPropertyUpdatedCheck), d, osm, checker.INFO) - require.ElementsMatch(t, []checker.ApiChange{ - { - Id: checker.NewRequiredRequestPropertyId, - Args: []any{"description"}, - Level: checker.ERR, - Operation: "POST", - Path: "/products", - Source: load.NewSource("../data/checker/request_property_added_revision2.yaml"), - OperationId: "addProduct", - }, - { - Id: checker.NewOptionalRequestPropertyId, - Args: []any{"info"}, - Level: checker.INFO, - Operation: "POST", - Path: "/products", - Source: load.NewSource("../data/checker/request_property_added_revision2.yaml"), - OperationId: "addProduct", - }}, errs) + require.Len(t, errs, 2) + + require.Equal(t, errs[0], checker.ApiChange{ + Id: checker.NewRequiredRequestPropertyId, + Args: []any{"description", "application/json"}, + Level: checker.ERR, + Operation: "POST", + Path: "/products", + Source: load.NewSource("../data/checker/request_property_added_revision2.yaml"), + OperationId: "addProduct", + }) + require.Equal(t, "added required request property 'description' to media-type 'application/json'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + + require.Equal(t, errs[1], checker.ApiChange{ + Id: checker.NewOptionalRequestPropertyId, + Args: []any{"info", "application/json"}, + Level: checker.INFO, + Operation: "POST", + Path: "/products", + Source: load.NewSource("../data/checker/request_property_added_revision2.yaml"), + OperationId: "addProduct", + }) + require.Equal(t, "added optional request property 'info' to media-type 'application/json'", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: adding a new optional request property @@ -76,13 +81,14 @@ func TestRequiredOptionalPropertyAdded(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.NewOptionalRequestPropertyId, - Args: []any{"description"}, + Args: []any{"description", "application/json"}, Level: checker.INFO, Operation: "POST", Path: "/products", Source: load.NewSource("../data/checker/request_property_added_revision.yaml"), OperationId: "addProduct", }, errs[0]) + require.Equal(t, "added optional request property 'description' to media-type 'application/json'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: removing a required request property @@ -98,16 +104,17 @@ func TestRequiredRequestPropertyRemoved(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.RequestPropertyRemovedId, - Args: []any{"description"}, + Args: []any{"description", "application/json"}, Level: checker.WARN, Operation: "POST", Path: "/products", Source: load.NewSource("../data/checker/request_property_added_base.yaml"), OperationId: "addProduct", }, errs[0]) + require.Equal(t, "removed request property 'description' of media-type 'application/json'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } -// CL: adding a new required request property with a default value +// CL: adding a new required request property with a default value: new-required-request-property-with-default func TestRequiredRequestPropertyAddedWithDefault(t *testing.T) { s1, err := open("../data/checker/request_property_added_base.yaml") require.NoError(t, err) @@ -120,11 +127,12 @@ func TestRequiredRequestPropertyAddedWithDefault(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.NewRequiredRequestPropertyWithDefaultId, - Args: []any{"description"}, + Args: []any{"description", "application/json"}, Level: checker.INFO, Operation: "POST", Path: "/products", Source: load.NewSource("../data/checker/request_property_added_with_default.yaml"), OperationId: "addProduct", }, errs[0]) + require.Equal(t, "added required request property 'description' with a default value to media-type 'application/json'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_response_pattern_added_or_changed.go b/checker/check_response_pattern_added_or_changed.go index 00850aae..6741376e 100644 --- a/checker/check_response_pattern_added_or_changed.go +++ b/checker/check_response_pattern_added_or_changed.go @@ -48,13 +48,13 @@ func ResponsePatternAddedOrChangedCheck(diffReport *diff.Diff, operationsSources propName := propertyFullName(propertyPath, propertyName) id := ResponsePropertyPatternChangedId - args := []any{propName, patternDiff.From, patternDiff.To, responseStatus} + args := []any{patternDiff.From, patternDiff.To, propName, responseStatus} if patternDiff.To == "" || patternDiff.To == nil { id = ResponsePropertyPatternRemovedId - args = []any{propName, patternDiff.From, responseStatus} + args = []any{patternDiff.From, propName, responseStatus} } else if patternDiff.From == "" || patternDiff.From == nil { id = ResponsePropertyPatternAddedId - args = []any{propName, patternDiff.To, responseStatus} + args = []any{patternDiff.To, propName, responseStatus} } result = append(result, NewApiChange( diff --git a/checker/check_response_pattern_added_or_changed_test.go b/checker/check_response_pattern_added_or_changed_test.go index ee03346d..1e09949d 100644 --- a/checker/check_response_pattern_added_or_changed_test.go +++ b/checker/check_response_pattern_added_or_changed_test.go @@ -24,14 +24,14 @@ func TestResponsePropertyPatternChanged(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.ResponsePropertyPatternChangedId, - Args: []any{"data/created", "^[a-z]+$", "^(?:([a-z]+-)*([a-z]+)?)$", "200"}, + Args: []any{"^[a-z]+$", "^(?:([a-z]+-)*([a-z]+)?)$", "data/created", "200"}, Level: checker.INFO, Operation: "POST", Path: "/api/v1.0/groups", Source: load.NewSource("../data/checker/response_pattern_added_or_changed_revision.yaml"), OperationId: "createOneGroup", }, errs[0]) - require.Equal(t, "the 'data/created' response's property pattern was changed from '^[a-z]+$' to '^(?:([a-z]+-)*([a-z]+)?)$' for the status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "changed pattern from '^[a-z]+$' to '^(?:([a-z]+-)*([a-z]+)?)$' in property 'data/created' for response status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: adding response property pattern @@ -49,14 +49,14 @@ func TestResponsePropertyPatternAdded(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.ResponsePropertyPatternAddedId, - Args: []any{"data/created", "^[a-z]+$", "200"}, + Args: []any{"^[a-z]+$", "data/created", "200"}, Level: checker.INFO, Operation: "POST", Path: "/api/v1.0/groups", Source: load.NewSource("../data/checker/response_pattern_added_or_changed_base.yaml"), OperationId: "createOneGroup", }, errs[0]) - require.Equal(t, "the 'data/created' response's property pattern '^[a-z]+$' was added for the status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "added pattern '^[a-z]+$' to property 'data/created' for response status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: removing response property pattern @@ -74,12 +74,12 @@ func TestResponsePropertyPatternRemoved(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: checker.ResponsePropertyPatternRemovedId, - Args: []any{"data/created", "^[a-z]+$", "200"}, + Args: []any{"^[a-z]+$", "data/created", "200"}, Level: checker.INFO, Operation: "POST", Path: "/api/v1.0/groups", Source: load.NewSource("../data/checker/response_pattern_added_or_changed_base.yaml"), OperationId: "createOneGroup", }, errs[0]) - require.Equal(t, "the 'data/created' response's property pattern '^[a-z]+$' was removed for the status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + require.Equal(t, "removed pattern '^[a-z]+$' from property 'data/created' for response status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_response_property_default_value_changed.go b/checker/check_response_property_default_value_changed.go index 8fe3fba4..fdfbf005 100644 --- a/checker/check_response_property_default_value_changed.go +++ b/checker/check_response_property_default_value_changed.go @@ -68,11 +68,11 @@ func ResponsePropertyDefaultValueChangedCheck(diffReport *diff.Diff, operationsS defaultValueDiff := propertyDiff.DefaultDiff if defaultValueDiff.From == nil { - appendResultItem(ResponsePropertyDefaultValueAddedId, propertyName, defaultValueDiff.To, responseStatus) + appendResultItem(ResponsePropertyDefaultValueAddedId, defaultValueDiff.To, propertyName, responseStatus) } else if defaultValueDiff.To == nil { - appendResultItem(ResponsePropertyDefaultValueRemovedId, propertyName, defaultValueDiff.From, responseStatus) + appendResultItem(ResponsePropertyDefaultValueRemovedId, defaultValueDiff.From, propertyName, responseStatus) } else { - appendResultItem(ResponsePropertyDefaultValueChangedId, propertyName, defaultValueDiff.From, defaultValueDiff.To, responseStatus) + appendResultItem(ResponsePropertyDefaultValueChangedId, defaultValueDiff.From, defaultValueDiff.To, propertyName, responseStatus) } }) } diff --git a/checker/check_response_property_default_value_changed_test.go b/checker/check_response_property_default_value_changed_test.go index c65b859e..cac70185 100644 --- a/checker/check_response_property_default_value_changed_test.go +++ b/checker/check_response_property_default_value_changed_test.go @@ -19,23 +19,28 @@ func TestResponsePropertyDefaultValueUpdatedCheck(t *testing.T) { require.NoError(t, err) errs := checker.CheckBackwardCompatibilityUntilLevel(singleCheckConfig(checker.ResponsePropertyDefaultValueChangedCheck), d, osm, checker.INFO) require.Len(t, errs, 2) - require.ElementsMatch(t, []checker.ApiChange{{ + + require.Equal(t, checker.ApiChange{ Id: checker.ResponsePropertyDefaultValueChangedId, - Args: []any{"created", "2020-01-01T00:00:00Z", "2020-02-01T00:00:00Z", "200"}, + Args: []any{"2020-01-01T00:00:00Z", "2020-02-01T00:00:00Z", "created", "200"}, Level: checker.INFO, Operation: "POST", Path: "/api/v1.0/groups", Source: load.NewSource("../data/checker/response_property_default_value_changed_revision.yaml"), OperationId: "createOneGroup", - }, { + }, errs[0]) + require.Equal(t, "changed default value from '2020-01-01T00:00:00Z' to '2020-02-01T00:00:00Z' for property 'created' for response status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + + require.Equal(t, checker.ApiChange{ Id: checker.ResponsePropertyDefaultValueChangedId, - Args: []any{"enabled", false, true, "200"}, + Args: []any{false, true, "enabled", "200"}, Level: checker.INFO, Operation: "POST", Path: "/api/v1.0/groups", Source: load.NewSource("../data/checker/response_property_default_value_changed_revision.yaml"), OperationId: "createOneGroup", - }}, errs) + }, errs[1]) + require.Equal(t, "changed default value from 'false' to 'true' for property 'enabled' for response status '200'", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: changing response body default value @@ -59,6 +64,7 @@ func TestResponseSchemaDefaultValueUpdatedCheck(t *testing.T) { Source: load.NewSource("../data/checker/response_property_default_value_changed_base.yaml"), OperationId: "createOneGroup", }, errs[0]) + require.Equal(t, "response body 'text/plain' default value changed from 'Error' to 'new default value' for status '404'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: adding response body default value or response body property default value @@ -75,7 +81,8 @@ func TestResponsePropertyDefaultValueAddedCheck(t *testing.T) { require.NoError(t, err) errs := checker.CheckBackwardCompatibilityUntilLevel(singleCheckConfig(checker.ResponsePropertyDefaultValueChangedCheck), d, osm, checker.INFO) require.Len(t, errs, 2) - require.ElementsMatch(t, []checker.ApiChange{{ + + require.Equal(t, checker.ApiChange{ Id: checker.ResponseBodyDefaultValueAddedId, Args: []any{"text/plain", "Error", "404"}, Level: checker.INFO, @@ -83,15 +90,19 @@ func TestResponsePropertyDefaultValueAddedCheck(t *testing.T) { Path: "/api/v1.0/groups", Source: load.NewSource("../data/checker/response_property_default_value_changed_base.yaml"), OperationId: "createOneGroup", - }, { + }, errs[0]) + require.Equal(t, "response body 'text/plain' default value 'Error' was added for status '404'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + + require.Equal(t, checker.ApiChange{ Id: checker.ResponsePropertyDefaultValueAddedId, - Args: []any{"created", "2020-01-01T00:00:00Z", "200"}, + Args: []any{"2020-01-01T00:00:00Z", "created", "200"}, Level: checker.INFO, Operation: "POST", Path: "/api/v1.0/groups", Source: load.NewSource("../data/checker/response_property_default_value_changed_base.yaml"), OperationId: "createOneGroup", - }}, errs) + }, errs[1]) + require.Equal(t, "added default value '2020-01-01T00:00:00Z' to response property 'created' for response status '200'", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: removing response body default value or response body property default value @@ -108,7 +119,8 @@ func TestResponsePropertyDefaultValueRemovedCheck(t *testing.T) { require.NoError(t, err) errs := checker.CheckBackwardCompatibilityUntilLevel(singleCheckConfig(checker.ResponsePropertyDefaultValueChangedCheck), d, osm, checker.INFO) require.Len(t, errs, 2) - require.ElementsMatch(t, []checker.ApiChange{{ + + require.Equal(t, checker.ApiChange{ Id: checker.ResponseBodyDefaultValueRemovedId, Args: []any{"text/plain", "Error", "404"}, Level: checker.INFO, @@ -116,13 +128,17 @@ func TestResponsePropertyDefaultValueRemovedCheck(t *testing.T) { Path: "/api/v1.0/groups", Source: load.NewSource("../data/checker/response_property_default_value_changed_base.yaml"), OperationId: "createOneGroup", - }, { + }, errs[0]) + require.Equal(t, "response body 'text/plain' default value 'Error' was removed for status '404'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) + + require.Equal(t, checker.ApiChange{ Id: checker.ResponsePropertyDefaultValueRemovedId, - Args: []any{"created", "2020-01-01T00:00:00Z", "200"}, + Args: []any{"2020-01-01T00:00:00Z", "created", "200"}, Level: checker.INFO, Operation: "POST", Path: "/api/v1.0/groups", Source: load.NewSource("../data/checker/response_property_default_value_changed_base.yaml"), OperationId: "createOneGroup", - }}, errs) + }, errs[1]) + require.Equal(t, "removed default value '2020-01-01T00:00:00Z' of property 'created' for response status '200'", errs[1].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/check_response_required_property_write_only_read_only_test.go b/checker/check_response_required_property_write_only_read_only_test.go index 99a5d6ab..a6880956 100644 --- a/checker/check_response_required_property_write_only_read_only_test.go +++ b/checker/check_response_required_property_write_only_read_only_test.go @@ -58,8 +58,8 @@ func TestResponseRequiredPropertyBecameNotWriteOnly(t *testing.T) { Source: load.NewSource("../data/checker/response_required_property_write_only_read_only_base.yaml"), OperationId: "createOneGroup", }, errs[0]) + require.Equal(t, "response required property 'data/writeOnlyName' became not write-only for status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) require.Equal(t, "It is valid only if the property was always returned before the specification has been changed", errs[0].GetComment(checker.NewDefaultLocalizer())) - require.Equal(t, "the response required property 'data/writeOnlyName' became not write-only for the status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: changing required response property to read-only @@ -85,6 +85,7 @@ func TestResponseRequiredPropertyBecameReadOnly(t *testing.T) { Source: load.NewSource("../data/checker/response_required_property_write_only_read_only_base.yaml"), OperationId: "createOneGroup", }, errs[0]) + require.Equal(t, "response required property 'data/id' became read-only for status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } // CL: changing required response property to not read-only @@ -111,4 +112,5 @@ func TestResponseRequiredPropertyBecameNonReadOnly(t *testing.T) { Source: load.NewSource("../data/checker/response_required_property_write_only_read_only_base.yaml"), OperationId: "createOneGroup", }, errs[0]) + require.Equal(t, "response required property 'data/id' became not read-only for status '200'", errs[0].GetUncolorizedText(checker.NewDefaultLocalizer())) } diff --git a/checker/checker_test.go b/checker/checker_test.go index 6bad706e..07eed368 100644 --- a/checker/checker_test.go +++ b/checker/checker_test.go @@ -8,7 +8,7 @@ import ( "github.com/tufin/oasdiff/diff" ) -// BC: decreasing stability level is breaking +// BC: decreasing stability level is breaking: api-stability-decreased func TestBreaking_StabilityLevelDecreased(t *testing.T) { s1, err := open(getDeprecationFile("base-beta-stability.yaml")) diff --git a/checker/example_test.go b/checker/example_test.go index cffc8397..c2cb79f6 100644 --- a/checker/example_test.go +++ b/checker/example_test.go @@ -65,7 +65,7 @@ func ExampleCheckBackwardCompatibility() { // Output: // 4 breaking changes: 1 error, 3 warning - // error at ../data/openapi-test3.yaml, in API GET /api/{domain}/{project}/badges/security-score removed the success response with the status '201' [response-success-status-removed]. + // error at ../data/openapi-test3.yaml, in API GET /api/{domain}/{project}/badges/security-score removed success response status '201' [response-success-status-removed]. // // warning at ../data/openapi-test3.yaml, in API GET /api/{domain}/{project}/badges/security-score deleted the 'cookie' request parameter 'test' [request-parameter-removed]. // diff --git a/checker/generator/checks_test.go b/checker/generator/checks_test.go new file mode 100644 index 00000000..877cb293 --- /dev/null +++ b/checker/generator/checks_test.go @@ -0,0 +1,12 @@ +package generator_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + "github.com/tufin/oasdiff/checker/generator" +) + +func TestGenerator(t *testing.T) { + require.NoError(t, generator.Generate()) +} diff --git a/checker/generator/data.go b/checker/generator/data.go new file mode 100644 index 00000000..f1601879 --- /dev/null +++ b/checker/generator/data.go @@ -0,0 +1,170 @@ +package generator + +import "slices" + +func getAll() ValueSets { + return slices.Concat( + getEndpoints(), + getRequest(), + getResponse(), + getComponents(), + ) +} + +func getRequest() ValueSets { + return slices.Concat( + NewValueSets([]string{"media-type", "request body"}, schemaValueSets), + NewValueSets([]string{"property", "media-type", "request body"}, schemaValueSets), + NewValueSets([]string{"request parameter"}, schemaValueSets), + NewValueSets(nil, operationValueSets), + ) +} + +func getResponse() ValueSets { + return slices.Concat( + NewValueSets([]string{"media-type", "response"}, schemaValueSets), + NewValueSets([]string{"property", "media-type", "response"}, schemaValueSets), + ) +} + +func getEndpoints() ValueSets { + return NewValueSets(nil, endpointValueSets) +} + +func getComponents() ValueSets { + return slices.Concat( + getSecurity(), + ) +} + +func getSecurity() ValueSets { + return NewValueSets(nil, securityValueSets) +} + +var securityValueSets = ValueSets{ + ValueSetB{ + predicativeAdjective: "%s", + nouns: []string{"endpoint scheme security"}, + actions: []string{"add", "remove"}, + }, + ValueSetB{ + predicativeAdjective: "%s", + hierarchy: []string{"global security scheme"}, + nouns: []string{"security scope"}, + actions: []string{"add", "remove"}, + }, +} + +var endpointValueSets = ValueSets{ + ValueSetA{ + nouns: []string{"stability"}, // /Paths/PathItem/Operation + actions: []string{"decrease"}, + }, + ValueSetA{ + nouns: []string{"api path", "api"}, + actions: []string{"remove"}, + adverb: []string{"without deprecation", "before sunset"}, + }, + ValueSetB{ + nouns: []string{"endpoint"}, // /Paths/PathItem + actions: []string{"add", "remove", "deprecate", "reactivate"}, + }, + ValueSetB{ + predicativeAdjective: "%s", + nouns: []string{"success response status", "non-success response status"}, // /Paths/PathItem/Operation/Responses/Response/content/media-type/ + actions: []string{"add", "remove"}, + }, + ValueSetA{ + nouns: []string{"operation id"}, + actions: []string{"change"}, + }, + ValueSetB{ + predicativeAdjective: "%s", + nouns: []string{"operation id", "tag"}, + actions: []string{"add", "remove"}, + }, + ValueSetB{ + predicativeAdjective: "%s", + hierarchy: []string{"endpoint security scheme"}, + nouns: []string{"security scope"}, + actions: []string{"add", "remove"}, + }, +} + +var operationValueSets = ValueSets{ + ValueSetB{ + nouns: []string{"required request body", "optional request body"}, + actions: []string{"add", "remove"}, + }, + ValueSetB{ + predicativeAdjective: "%s", + attributiveAdjective: "%s", + nouns: []string{"request parameter"}, + actions: []string{"add", "remove"}, + }, +} + +var schemaValueSets = ValueSets{ + ValueSetA{ + predicativeAdjective: "value", + nouns: []string{"max", "maxLength", "min", "minLength", "minItems", "maxItems"}, + actions: []string{"set", "increase", "decrease"}, + }, + ValueSetA{ + nouns: []string{"type/format"}, + actions: []string{"change", "generalize"}, + }, + ValueSetA{ + nouns: []string{"discriminator property name"}, + actions: []string{"change"}, + }, + ValueSetA{ + nouns: []string{"pattern"}, + actions: []string{"change", "generalize"}, + }, + ValueSetA{ + nouns: []string{"required property", "optional property"}, + actions: []string{"change"}, + }, + ValueSetB{ + predicativeAdjective: "%s", + nouns: []string{"pattern"}, + actions: []string{"add", "remove"}, + }, + ValueSetB{ + nouns: []string{"default value"}, + actions: []string{"add", "remove"}, + }, + ValueSetB{ + predicativeAdjective: "%s", + hierarchy: []string{"anyOf list"}, + nouns: []string{"schema"}, + actions: []string{"add", "remove"}, + }, + ValueSetB{ + predicativeAdjective: "%s", + hierarchy: []string{"anyOf list"}, + nouns: []string{"schema"}, + actions: []string{"add", "remove"}, + }, + ValueSetB{ + predicativeAdjective: "%s", + hierarchy: []string{"anyOf list"}, + nouns: []string{"schema"}, + actions: []string{"add", "remove"}, + }, + ValueSetB{ + predicativeAdjective: "%s", + nouns: []string{"discriminator", "mapping keys"}, + actions: []string{"add", "remove"}, + }, +} + +/* +missing: +api-deprecated-sunset-parse +api-path-sunset-parse +api-invalid-stability-level +api-deprecated-sunset-missing +api-sunset-date-too-small +*/ diff --git a/checker/generator/generator.go b/checker/generator/generator.go new file mode 100644 index 00000000..3831d168 --- /dev/null +++ b/checker/generator/generator.go @@ -0,0 +1,139 @@ +package generator + +import ( + "os" + "slices" + "strings" + + "github.com/iancoleman/strcase" +) + +func Generate() error { + out, err := os.Create("messages.yaml") + if err != nil { + return err + } + defer out.Close() + + getAll().generate(out) + + return nil +} + +func isEmpty(s string) bool { + return s == "" +} + +func filterStrings(list []string, f func(string) bool) []string { + var result []string + for _, s := range list { + if !f(s) { + result = append(result, s) + } + } + return result +} + +func generateId(hierarchy []string, noun, action string) string { + if before, _, found := strings.Cut(noun, "/"); found { + noun = before + } + + return strcase.ToKebab(strings.Join(filterStrings([]string{concat(hierarchy), noun, conjugate(action)}, isEmpty), "-")) +} + +func concat(list []string) string { + if len(list) == 0 { + return "" + } + + copy := slices.Clone(list) + slices.Reverse(copy) + return strings.Join(copy, "-") +} + +func getHierarchyPostfix(action string, hierarchy []string) string { + if len(hierarchy) == 0 { + return "" + } + + return getPreposition(action) + " " + getHierarchyMessage(hierarchy) +} + +func getHierarchyMessage(hierarchy []string) string { + + copy := slices.Clone(hierarchy) + + for i, s := range hierarchy { + if isAtttibuted(s) { + copy[i] = "%s " + s + } + } + result := strings.Join(copy, " %s of ") + + if hierarchy != nil && !isTopLevel(hierarchy[len(hierarchy)-1]) { + result += " %s" + } + + return result +} + +func isTopLevel(s string) bool { + return s == "request body" || + s == "paths" +} + +func isAtttibuted(s string) bool { + return s == "request parameter" +} + +func standardizeSpaces(s string) string { + return strings.Join(strings.Fields(s), " ") +} + +func getActionMessage(action string) string { + switch getArity(action) { + case 0: + return "" + case 1: + return " to %s" + case 2: + return " from %s to %s" + default: + return "" + } +} + +func getArity(action string) int { + switch action { + case "add", "remove": + return 0 + case "set": + return 1 + } + return 2 +} + +func conjugate(verb string) string { + switch verb { + case "set": + return "set" + case "add": + return "added" + case "become": + return "became" + } + return verb + "d" +} + +func getPreposition(action string) string { + switch action { + case "add": + return "to" + } + return "from" +} + +func addAttribute(noun, attributiveAdjective, predicativeAdjective string) string { + return strings.Join([]string{attributiveAdjective + " " + noun + " " + predicativeAdjective}, " ") +} diff --git a/checker/generator/messages.yaml b/checker/generator/messages.yaml new file mode 100644 index 00000000..79612083 --- /dev/null +++ b/checker/generator/messages.yaml @@ -0,0 +1,225 @@ +stability-decreased: stability was decreased from %s to %s +api-path-removed: api path was removed without deprecation +api-path-removed: api path was removed before sunset +api-removed: api was removed without deprecation +api-removed: api was removed before sunset +endpoint-added: added endpoint +endpoint-removed: removed endpoint +endpoint-deprecated: deprecated endpoint +endpoint-reactivated: reactivated endpoint +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 +operation-id-changed: operation id was changed from %s to %s +operation-id-added: added operation id %s +operation-id-removed: removed operation id %s +tag-added: added tag %s +tag-removed: removed tag %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 +request-body-media-type-max-length-set: maxLength value of media-type %s of request body was set to %s +request-body-media-type-max-length-increased: maxLength value of media-type %s of request body was increased from %s to %s +request-body-media-type-max-length-decreased: maxLength value of media-type %s of request body was decreased from %s to %s +request-body-media-type-min-set: min value of media-type %s of request body was set to %s +request-body-media-type-min-increased: min value of media-type %s of request body was increased from %s to %s +request-body-media-type-min-decreased: min value of media-type %s of request body was decreased from %s to %s +request-body-media-type-min-length-set: minLength value of media-type %s of request body was set to %s +request-body-media-type-min-length-increased: minLength value of media-type %s of request body was increased from %s to %s +request-body-media-type-min-length-decreased: minLength value of media-type %s of request body was decreased from %s to %s +request-body-media-type-min-items-set: minItems value of media-type %s of request body was set to %s +request-body-media-type-min-items-increased: minItems value of media-type %s of request body was increased from %s to %s +request-body-media-type-min-items-decreased: minItems value of media-type %s of request body was decreased from %s to %s +request-body-media-type-max-items-set: maxItems value of media-type %s of request body was set to %s +request-body-media-type-max-items-increased: maxItems value of media-type %s of request body was increased from %s to %s +request-body-media-type-max-items-decreased: maxItems value of media-type %s of request body was decreased from %s to %s +request-body-media-type-type-changed: type/format of media-type %s of request body was changed from %s to %s +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-pattern-generalized: pattern of media-type %s of request body was generalized 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 +request-body-media-type-default-value-removed: removed default value from media-type %s of request body +request-body-media-type-any-of-list-schema-added: added schema %s to anyOf list %s of media-type %s of request body +request-body-media-type-any-of-list-schema-removed: removed schema %s from anyOf list %s of media-type %s of request body +request-body-media-type-any-of-list-schema-added: added schema %s to anyOf list %s of media-type %s of request body +request-body-media-type-any-of-list-schema-removed: removed schema %s from anyOf list %s of media-type %s of request body +request-body-media-type-any-of-list-schema-added: added schema %s to anyOf list %s of media-type %s of request body +request-body-media-type-any-of-list-schema-removed: removed schema %s from anyOf list %s of media-type %s of request body +request-body-media-type-discriminator-added: added discriminator %s to media-type %s of request body +request-body-media-type-discriminator-removed: removed discriminator %s from media-type %s of request body +request-body-media-type-mapping-keys-added: added mapping keys %s to media-type %s of request body +request-body-media-type-mapping-keys-removed: removed mapping keys %s from media-type %s of request body +request-body-media-type-property-max-set: max value of property %s of media-type %s of request body was set to %s +request-body-media-type-property-max-increased: max value of property %s of media-type %s of request body was increased from %s to %s +request-body-media-type-property-max-decreased: max value of property %s of media-type %s of request body was decreased from %s to %s +request-body-media-type-property-max-length-set: maxLength value of property %s of media-type %s of request body was set to %s +request-body-media-type-property-max-length-increased: maxLength value of property %s of media-type %s of request body was increased from %s to %s +request-body-media-type-property-max-length-decreased: maxLength value of property %s of media-type %s of request body was decreased from %s to %s +request-body-media-type-property-min-set: min value of property %s of media-type %s of request body was set to %s +request-body-media-type-property-min-increased: min value of property %s of media-type %s of request body was increased from %s to %s +request-body-media-type-property-min-decreased: min value of property %s of media-type %s of request body was decreased from %s to %s +request-body-media-type-property-min-length-set: minLength value of property %s of media-type %s of request body was set to %s +request-body-media-type-property-min-length-increased: minLength value of property %s of media-type %s of request body was increased from %s to %s +request-body-media-type-property-min-length-decreased: minLength value of property %s of media-type %s of request body was decreased from %s to %s +request-body-media-type-property-min-items-set: minItems value of property %s of media-type %s of request body was set to %s +request-body-media-type-property-min-items-increased: minItems value of property %s of media-type %s of request body was increased from %s to %s +request-body-media-type-property-min-items-decreased: minItems value of property %s of media-type %s of request body was decreased from %s to %s +request-body-media-type-property-max-items-set: maxItems value of property %s of media-type %s of request body was set to %s +request-body-media-type-property-max-items-increased: maxItems value of property %s of media-type %s of request body was increased from %s to %s +request-body-media-type-property-max-items-decreased: maxItems value of property %s of media-type %s of request body was decreased from %s to %s +request-body-media-type-property-type-changed: type/format of property %s of media-type %s of request body was changed from %s to %s +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-pattern-generalized: pattern of property %s of media-type %s of request body was generalized 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 +request-body-media-type-property-default-value-removed: removed default value from property %s of media-type %s of request body +request-body-media-type-property-any-of-list-schema-added: added schema %s to anyOf list %s of property %s of media-type %s of request body +request-body-media-type-property-any-of-list-schema-removed: removed schema %s from anyOf list %s of property %s of media-type %s of request body +request-body-media-type-property-any-of-list-schema-added: added schema %s to anyOf list %s of property %s of media-type %s of request body +request-body-media-type-property-any-of-list-schema-removed: removed schema %s from anyOf list %s of property %s of media-type %s of request body +request-body-media-type-property-any-of-list-schema-added: added schema %s to anyOf list %s of property %s of media-type %s of request body +request-body-media-type-property-any-of-list-schema-removed: removed schema %s from anyOf list %s of property %s of media-type %s of request body +request-body-media-type-property-discriminator-added: added discriminator %s to property %s of media-type %s of request body +request-body-media-type-property-discriminator-removed: removed discriminator %s from property %s of media-type %s of request body +request-body-media-type-property-mapping-keys-added: added mapping keys %s to property %s of media-type %s of request body +request-body-media-type-property-mapping-keys-removed: removed mapping keys %s from property %s of media-type %s of request body +request-parameter-max-set: max value of %s request parameter %s was set to %s +request-parameter-max-increased: max value of %s request parameter %s was increased from %s to %s +request-parameter-max-decreased: max value of %s request parameter %s was decreased from %s to %s +request-parameter-max-length-set: maxLength value of %s request parameter %s was set to %s +request-parameter-max-length-increased: maxLength value of %s request parameter %s was increased from %s to %s +request-parameter-max-length-decreased: maxLength value of %s request parameter %s was decreased from %s to %s +request-parameter-min-set: min value of %s request parameter %s was set to %s +request-parameter-min-increased: min value of %s request parameter %s was increased from %s to %s +request-parameter-min-decreased: min value of %s request parameter %s was decreased from %s to %s +request-parameter-min-length-set: minLength value of %s request parameter %s was set to %s +request-parameter-min-length-increased: minLength value of %s request parameter %s was increased from %s to %s +request-parameter-min-length-decreased: minLength value of %s request parameter %s was decreased from %s to %s +request-parameter-min-items-set: minItems value of %s request parameter %s was set to %s +request-parameter-min-items-increased: minItems value of %s request parameter %s was increased from %s to %s +request-parameter-min-items-decreased: minItems value of %s request parameter %s was decreased from %s to %s +request-parameter-max-items-set: maxItems value of %s request parameter %s was set to %s +request-parameter-max-items-increased: maxItems value of %s request parameter %s was increased from %s to %s +request-parameter-max-items-decreased: maxItems value of %s request parameter %s was decreased from %s to %s +request-parameter-type-changed: type/format of %s request parameter %s was changed from %s to %s +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-pattern-generalized: pattern of %s request parameter %s was generalized 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 +request-parameter-default-value-removed: removed default value from %s request parameter %s +request-parameter-any-of-list-schema-added: added schema %s to anyOf list %s of %s request parameter %s +request-parameter-any-of-list-schema-removed: removed schema %s from anyOf list %s of %s request parameter %s +request-parameter-any-of-list-schema-added: added schema %s to anyOf list %s of %s request parameter %s +request-parameter-any-of-list-schema-removed: removed schema %s from anyOf list %s of %s request parameter %s +request-parameter-any-of-list-schema-added: added schema %s to anyOf list %s of %s request parameter %s +request-parameter-any-of-list-schema-removed: removed schema %s from anyOf list %s of %s request parameter %s +request-parameter-discriminator-added: added discriminator %s to %s request parameter %s +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 +request-parameter-added: added %s request parameter %s +request-parameter-removed: removed %s request parameter %s +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 +response-media-type-max-length-set: maxLength value of media-type %s of response %s was set to %s +response-media-type-max-length-increased: maxLength value of media-type %s of response %s was increased from %s to %s +response-media-type-max-length-decreased: maxLength value of media-type %s of response %s was decreased from %s to %s +response-media-type-min-set: min value of media-type %s of response %s was set to %s +response-media-type-min-increased: min value of media-type %s of response %s was increased from %s to %s +response-media-type-min-decreased: min value of media-type %s of response %s was decreased from %s to %s +response-media-type-min-length-set: minLength value of media-type %s of response %s was set to %s +response-media-type-min-length-increased: minLength value of media-type %s of response %s was increased from %s to %s +response-media-type-min-length-decreased: minLength value of media-type %s of response %s was decreased from %s to %s +response-media-type-min-items-set: minItems value of media-type %s of response %s was set to %s +response-media-type-min-items-increased: minItems value of media-type %s of response %s was increased from %s to %s +response-media-type-min-items-decreased: minItems value of media-type %s of response %s was decreased from %s to %s +response-media-type-max-items-set: maxItems value of media-type %s of response %s was set to %s +response-media-type-max-items-increased: maxItems value of media-type %s of response %s was increased from %s to %s +response-media-type-max-items-decreased: maxItems value of media-type %s of response %s was decreased from %s to %s +response-media-type-type-changed: type/format of media-type %s of response %s was changed from %s to %s +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-pattern-generalized: pattern of media-type %s of response %s was generalized 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 +response-media-type-default-value-removed: removed default value from media-type %s of response %s +response-media-type-any-of-list-schema-added: added schema %s to anyOf list %s of media-type %s of response %s +response-media-type-any-of-list-schema-removed: removed schema %s from anyOf list %s of media-type %s of response %s +response-media-type-any-of-list-schema-added: added schema %s to anyOf list %s of media-type %s of response %s +response-media-type-any-of-list-schema-removed: removed schema %s from anyOf list %s of media-type %s of response %s +response-media-type-any-of-list-schema-added: added schema %s to anyOf list %s of media-type %s of response %s +response-media-type-any-of-list-schema-removed: removed schema %s from anyOf list %s of media-type %s of response %s +response-media-type-discriminator-added: added discriminator %s to media-type %s of response %s +response-media-type-discriminator-removed: removed discriminator %s from media-type %s of response %s +response-media-type-mapping-keys-added: added mapping keys %s to media-type %s of response %s +response-media-type-mapping-keys-removed: removed mapping keys %s from media-type %s of response %s +response-media-type-property-max-set: max value of property %s of media-type %s of response %s was set to %s +response-media-type-property-max-increased: max value of property %s of media-type %s of response %s was increased from %s to %s +response-media-type-property-max-decreased: max value of property %s of media-type %s of response %s was decreased from %s to %s +response-media-type-property-max-length-set: maxLength value of property %s of media-type %s of response %s was set to %s +response-media-type-property-max-length-increased: maxLength value of property %s of media-type %s of response %s was increased from %s to %s +response-media-type-property-max-length-decreased: maxLength value of property %s of media-type %s of response %s was decreased from %s to %s +response-media-type-property-min-set: min value of property %s of media-type %s of response %s was set to %s +response-media-type-property-min-increased: min value of property %s of media-type %s of response %s was increased from %s to %s +response-media-type-property-min-decreased: min value of property %s of media-type %s of response %s was decreased from %s to %s +response-media-type-property-min-length-set: minLength value of property %s of media-type %s of response %s was set to %s +response-media-type-property-min-length-increased: minLength value of property %s of media-type %s of response %s was increased from %s to %s +response-media-type-property-min-length-decreased: minLength value of property %s of media-type %s of response %s was decreased from %s to %s +response-media-type-property-min-items-set: minItems value of property %s of media-type %s of response %s was set to %s +response-media-type-property-min-items-increased: minItems value of property %s of media-type %s of response %s was increased from %s to %s +response-media-type-property-min-items-decreased: minItems value of property %s of media-type %s of response %s was decreased from %s to %s +response-media-type-property-max-items-set: maxItems value of property %s of media-type %s of response %s was set to %s +response-media-type-property-max-items-increased: maxItems value of property %s of media-type %s of response %s was increased from %s to %s +response-media-type-property-max-items-decreased: maxItems value of property %s of media-type %s of response %s was decreased from %s to %s +response-media-type-property-type-changed: type/format of property %s of media-type %s of response %s was changed from %s to %s +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-pattern-generalized: pattern of property %s of media-type %s of response %s was generalized 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 +response-media-type-property-default-value-removed: removed default value from property %s of media-type %s of response %s +response-media-type-property-any-of-list-schema-added: added schema %s to anyOf list %s of property %s of media-type %s of response %s +response-media-type-property-any-of-list-schema-removed: removed schema %s from anyOf list %s of property %s of media-type %s of response %s +response-media-type-property-any-of-list-schema-added: added schema %s to anyOf list %s of property %s of media-type %s of response %s +response-media-type-property-any-of-list-schema-removed: removed schema %s from anyOf list %s of property %s of media-type %s of response %s +response-media-type-property-any-of-list-schema-added: added schema %s to anyOf list %s of property %s of media-type %s of response %s +response-media-type-property-any-of-list-schema-removed: removed schema %s from anyOf list %s of property %s of media-type %s of response %s +response-media-type-property-discriminator-added: added discriminator %s to property %s of media-type %s of response %s +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 diff --git a/checker/generator/value_set.go b/checker/generator/value_set.go new file mode 100644 index 00000000..c9b34a63 --- /dev/null +++ b/checker/generator/value_set.go @@ -0,0 +1,103 @@ +package generator + +import ( + "fmt" + "io" + "strings" +) + +type ValueSets []IValueSet + +// NewValueSets creates a new ValueSets object +func NewValueSets(hierarchy []string, valueSets ValueSets) ValueSets { + + result := make(ValueSets, len(valueSets)) + + for i, vs := range valueSets { + result[i] = vs.setHierarchy(hierarchy) + } + + return result +} + +func (vs ValueSets) generate(out io.Writer) { + for _, v := range vs { + v.generate(out) + } +} + +type IValueSet interface { + generate(out io.Writer) + setHierarchy(hierarchy []string) IValueSet +} + +type ValueSet struct { + attributiveAdjective string // attributive adjectives are added before the noun + predicativeAdjective string // predicative adjectives are added after the noun + hierarchy []string + nouns []string + actions []string + adverb []string +} + +func (v ValueSet) setHierarchy(hierarchy []string) ValueSet { + if len(hierarchy) == 0 { + return v + } + + v.hierarchy = append(v.hierarchy, hierarchy...) + + return v +} + +// ValueSetA messages start with the noun +type ValueSetA ValueSet + +func (v ValueSetA) setHierarchy(hierarchy []string) IValueSet { + return ValueSetA(ValueSet(v).setHierarchy(hierarchy)) +} + +func (v ValueSetA) generate(out io.Writer) { + generateMessage := func(hierarchy []string, noun, attributiveAdjective, predicativeAdjective, action, adverb string) string { + prefix := addAttribute(noun, attributiveAdjective, predicativeAdjective) + if hierarchyMessage := getHierarchyMessage(hierarchy); hierarchyMessage != "" { + prefix += " of " + hierarchyMessage + } + + return standardizeSpaces(fmt.Sprintf("%s was %s %s %s", prefix, conjugate(action), getActionMessage(action), adverb)) + } + + for _, noun := range v.nouns { + for _, action := range v.actions { + id := generateId(v.hierarchy, noun, action) + + adverbs := v.adverb + if v.adverb == nil { + adverbs = []string{""} + } + for _, adverb := range adverbs { + message := generateMessage(v.hierarchy, noun, v.attributiveAdjective, v.predicativeAdjective, action, adverb) + fmt.Fprintln(out, fmt.Sprintf("%s: %s", id, message)) + } + } + } +} + +// ValueSetB messages start with the action +type ValueSetB ValueSet + +func (v ValueSetB) setHierarchy(hierarchy []string) IValueSet { + return ValueSetB(ValueSet(v).setHierarchy(hierarchy)) +} + +func (v ValueSetB) generate(out io.Writer) { + generateMessage := func(hierarchy []string, noun, attributiveAdjective, predicativeAdjective, action string) string { + return standardizeSpaces(strings.Join([]string{conjugate(action), addAttribute(noun, attributiveAdjective, predicativeAdjective), getHierarchyPostfix(action, hierarchy)}, " ")) + } + + for _, noun := range v.nouns { + for _, action := range v.actions { + fmt.Fprintln(out, fmt.Sprintf("%s: %s", generateId(v.hierarchy, noun, action), generateMessage(v.hierarchy, noun, v.attributiveAdjective, v.predicativeAdjective, action))) + } + } +} diff --git a/checker/localizations/localizations.go b/checker/localizations/localizations.go index 9dbb9d5f..38cb602a 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 -// 2024-07-17 10:54:08.151759 +0300 IDT m=+0.013463284 +// 2024-08-29 23:38:04.760758 +0300 IDT m=+0.007109585 package localizations @@ -12,71 +12,70 @@ import ( ) var localizations = map[string]string{ - "en.messages.api-deprecated-sunset-missing": "sunset date is missing for deprecated API", - "en.messages.api-deprecated-sunset-missing-description": "endpoint deprecated without sunset date", - "en.messages.api-deprecated-sunset-parse": "failed to parse sunset date: %v", - "en.messages.api-deprecated-sunset-parse-description": "endpoint deprecated with invalid 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", - "en.messages.api-global-security-removed": "the security scheme %s was removed from the API", - "en.messages.api-global-security-removed-description": "security scheme deleted in security", - "en.messages.api-global-security-scope-added": "the security scope %s was added to the global security scheme %s", - "en.messages.api-global-security-scope-added-description": "scope added to a security scheme in security", - "en.messages.api-global-security-scope-removed": "the security scope %s was removed from the global security scheme %s", - "en.messages.api-global-security-scope-removed-description": "scope deleted from a security scheme in security", - "en.messages.api-invalid-stability-level": "failed to parse stability level: %v", - "en.messages.api-invalid-stability-level-description": "invalid stability level", - "en.messages.api-operation-id-added": "api operation id %s was added", - "en.messages.api-operation-id-added-description": "operation ID added to an endpoint", - "en.messages.api-operation-id-removed": "api operation id %s removed and replaced with %s", - "en.messages.api-operation-id-removed-description": "operation ID deleted from an endpoint", - "en.messages.api-path-removed-before-sunset": "api path removed before the sunset date %s", - "en.messages.api-path-removed-before-sunset-description": "path and endpoint deleted before sunset date", - "en.messages.api-path-removed-without-deprecation": "api path removed without deprecation", - "en.messages.api-path-removed-without-deprecation-description": "path and endpoint deleted without deprecation", - "en.messages.api-path-sunset-parse": "failed to parse sunset date: %v", - "en.messages.api-path-sunset-parse-description": "path and endpoint deleted with invalid or missing sunset date", - "en.messages.api-removed-before-sunset": "api removed before the sunset date %s", - "en.messages.api-removed-before-sunset-description": "endpoint deleted before sunset date", - "en.messages.api-removed-without-deprecation": "api removed without deprecation", - "en.messages.api-removed-without-deprecation-description": "endpoint deleted without deprecation", - "en.messages.api-schema-removed": "removed the schema %s", - "en.messages.api-schema-removed-description": "schema deleted from components/schemas", - "en.messages.api-security-added": "the endpoint scheme security %s was added to the API", - "en.messages.api-security-added-description": "security requirements added to endpoint", - "en.messages.api-security-component-added": "the component security scheme %s was added", - "en.messages.api-security-component-added-description": "security scheme added in components/securitySchemes", - "en.messages.api-security-component-oauth-scope-added": "the component security scheme %s oauth scope %s was added", - "en.messages.api-security-component-oauth-scope-added-description": "scope added to OAuth flow in components/securitySchemes", - "en.messages.api-security-component-oauth-scope-changed": "the component security scheme %s oauth scope %s was updated from %s to %s", - "en.messages.api-security-component-oauth-scope-changed-description": "scope modified in OAuth flow in components/securitySchemes", - "en.messages.api-security-component-oauth-scope-removed": "the component security scheme %s oauth scope %s was removed", - "en.messages.api-security-component-oauth-scope-removed-description": "scope deleted from OAuth flow in components/securitySchemes", - "en.messages.api-security-component-oauth-token-url-changed": "the component security scheme %s oauth token url changed from %s to %s", - "en.messages.api-security-component-oauth-token-url-changed-description": "token URL modified in OAuth flow in components/securitySchemes", - "en.messages.api-security-component-oauth-url-changed": "the component security scheme %s oauth url changed from %s to %s", - "en.messages.api-security-component-oauth-url-changed-description": "auth URL modified in OAuth flow in components/securitySchemes", - "en.messages.api-security-component-removed": "the component security scheme %s was removed", - "en.messages.api-security-component-removed-description": "security scheme deleted in components/securitySchemes", - "en.messages.api-security-component-type-changed": "the component security scheme %s type changed from %s to %s", - "en.messages.api-security-component-type-changed-description": "security scheme type modified in components/securitySchemes", - "en.messages.api-security-removed": "the endpoint scheme security %s was removed from the API", - "en.messages.api-security-removed-description": "security requirements deleted from endpoint", - "en.messages.api-security-scope-added": "the security scope %s was added to the endpoint's security scheme %s", - "en.messages.api-security-scope-added-description": "scope added to an endpoint's security scheme", - "en.messages.api-security-scope-removed": "the security scope %s was removed from the endpoint's security scheme %s", - "en.messages.api-security-scope-removed-description": "scope deleted from an endpoint's security scheme", - "en.messages.api-security-updated": "the endpoint scheme security %s was updated from %s to %s", - "en.messages.api-stability-decreased": "endpoint stability level decreased from %s to %s", - "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 %s 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": "sunset date %s is too small, must be at least %s 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", - "en.messages.api-tag-removed": "api tag %s removed", - "en.messages.api-tag-removed-description": "endpoint tag deleted", + "en.messages.api-deprecated-sunset-missing": "sunset date is missing for deprecated API", + "en.messages.api-deprecated-sunset-missing-description": "endpoint deprecated without sunset date", + "en.messages.api-deprecated-sunset-parse": "failed to parse sunset date: %v", + "en.messages.api-deprecated-sunset-parse-description": "endpoint deprecated with invalid sunset date", + "en.messages.api-global-security-added": "security scheme %s was added", + "en.messages.api-global-security-added-description": "security scheme added in security", + "en.messages.api-global-security-removed": "removed security scheme %s", + "en.messages.api-global-security-removed-description": "security scheme deleted in security", + "en.messages.api-global-security-scope-added": "security scope %s was added to global security scheme %s", + "en.messages.api-global-security-scope-added-description": "scope added to a security scheme in security", + "en.messages.api-global-security-scope-removed": "removed security scope %s from global security scheme %s", + "en.messages.api-global-security-scope-removed-description": "scope deleted from a security scheme in security", + "en.messages.api-invalid-stability-level": "failed to parse stability level: %v", + "en.messages.api-invalid-stability-level-description": "invalid stability level", + "en.messages.api-operation-id-added": "api operation id %s was added", + "en.messages.api-operation-id-added-description": "operation ID added to an endpoint", + "en.messages.api-operation-id-removed": "api operation id %s removed and replaced with %s", + "en.messages.api-operation-id-removed-description": "operation ID deleted from an endpoint", + "en.messages.api-path-removed-before-sunset": "api path removed before the sunset date %s", + "en.messages.api-path-removed-before-sunset-description": "path and endpoint deleted before sunset date", + "en.messages.api-path-removed-without-deprecation": "api path removed without deprecation", + "en.messages.api-path-removed-without-deprecation-description": "path and endpoint deleted without deprecation", + "en.messages.api-path-sunset-parse": "failed to parse sunset date: %v", + "en.messages.api-path-sunset-parse-description": "path and endpoint deleted with invalid or missing sunset date", + "en.messages.api-removed-before-sunset": "api removed before the sunset date %s", + "en.messages.api-removed-before-sunset-description": "endpoint deleted before sunset date", + "en.messages.api-removed-without-deprecation": "api removed without deprecation", + "en.messages.api-removed-without-deprecation-description": "endpoint deleted without deprecation", + "en.messages.api-schema-removed": "removed schema %s", + "en.messages.api-schema-removed-description": "schema deleted from components/schemas", + "en.messages.api-security-added": "endpoint scheme security %s was added", + "en.messages.api-security-added-description": "security requirements added to endpoint", + "en.messages.api-security-component-added": "component security scheme %s was added", + "en.messages.api-security-component-added-description": "security scheme added in components/securitySchemes", + "en.messages.api-security-component-oauth-scope-added": "component security scheme %s oauth scope %s was added", + "en.messages.api-security-component-oauth-scope-added-description": "scope added to OAuth flow in components/securitySchemes", + "en.messages.api-security-component-oauth-scope-changed": "component security scheme %s oauth scope %s was updated from %s to %s", + "en.messages.api-security-component-oauth-scope-changed-description": "scope modified in OAuth flow in components/securitySchemes", + "en.messages.api-security-component-oauth-scope-removed": "removed component security scheme %s oauth scope %s", + "en.messages.api-security-component-oauth-scope-removed-description": "scope deleted from OAuth flow in components/securitySchemes", + "en.messages.api-security-component-oauth-token-url-changed": "component security scheme %s oauth token url changed from %s to %s", + "en.messages.api-security-component-oauth-token-url-changed-description": "token URL modified in OAuth flow in components/securitySchemes", + "en.messages.api-security-component-oauth-url-changed": "component security scheme %s oauth url changed from %s to %s", + "en.messages.api-security-component-oauth-url-changed-description": "auth URL modified in OAuth flow in components/securitySchemes", + "en.messages.api-security-component-removed": "removed component security scheme %s", + "en.messages.api-security-component-removed-description": "security scheme deleted in components/securitySchemes", + "en.messages.api-security-component-type-changed": "component security scheme %s type changed from %s to %s", + "en.messages.api-security-component-type-changed-description": "security scheme type modified in components/securitySchemes", + "en.messages.api-security-removed": "removed endpoint scheme security %s", + "en.messages.api-security-removed-description": "security requirements deleted from endpoint", + "en.messages.api-security-scope-added": "security scope %s was added to endpoint security scheme %s", + "en.messages.api-security-scope-added-description": "scope added to an endpoint's security scheme", + "en.messages.api-security-scope-removed": "removed security scope %s from endpoint security scheme %s", + "en.messages.api-security-scope-removed-description": "scope deleted from an endpoint's security scheme", + "en.messages.api-stability-decreased": "endpoint stability level decreased from %s to %s", + "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 %s 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": "sunset date %s is too small, must be at least %s days from now", + "en.messages.api-sunset-date-too-small-description": "deprecated endpoint sunset before min required deprecation days", + "en.messages.api-tag-added": "added api tag %s", + "en.messages.api-tag-added-description": "endpoint tag added", + "en.messages.api-tag-removed": "removed api tag %s", + "en.messages.api-tag-removed-description": "endpoint tag deleted", "en.messages.at": "at", "en.messages.endpoint-added": "endpoint added", "en.messages.endpoint-added-description": "endpoint added", @@ -85,475 +84,475 @@ var localizations = map[string]string{ "en.messages.endpoint-reactivated": "endpoint reactivated", "en.messages.endpoint-reactivated-description": "endpoint reactivated (deprecation set to false)", "en.messages.in": "in", - "en.messages.new-optional-request-default-parameter-to-existing-path": "added the new optional %s request parameter %s to all path's operations", + "en.messages.new-optional-request-default-parameter-to-existing-path": "added optional %s request parameter %s to all path's operations", "en.messages.new-optional-request-default-parameter-to-existing-path-description": "optional request parameter added at path level", - "en.messages.new-optional-request-parameter": "added the new optional %s request parameter %s", + "en.messages.new-optional-request-parameter": "added optional %s request parameter %s", "en.messages.new-optional-request-parameter-description": "optional request parameter added to endpoint", - "en.messages.new-optional-request-property": "added the new optional request property %s", + "en.messages.new-optional-request-property": "added optional request property %s to media-type %s", "en.messages.new-optional-request-property-description": "optional property added to request", - "en.messages.new-request-path-parameter": "added the new path request parameter %s", + "en.messages.new-request-path-parameter": "added path request parameter %s", "en.messages.new-request-path-parameter-description": "new request path parameter", - "en.messages.new-required-request-default-parameter-to-existing-path": "added the new required %s request parameter %s to all path's operations", + "en.messages.new-required-request-default-parameter-to-existing-path": "added required %s request parameter %s to all path's operations", "en.messages.new-required-request-default-parameter-to-existing-path-description": "required request parameter added at path level", - "en.messages.new-required-request-header-property": "added the new required %s request header's property %s", + "en.messages.new-required-request-header-property": "added required %s request header property %s", "en.messages.new-required-request-header-property-description": "new required request header", - "en.messages.new-required-request-parameter": "added the new required %s request parameter %s", + "en.messages.new-required-request-parameter": "added required %s request parameter %s", "en.messages.new-required-request-parameter-description": "required request parameter added to endpoint", - "en.messages.new-required-request-property": "added the new required request property %s", + "en.messages.new-required-request-property": "added required request property %s to media-type %s", "en.messages.new-required-request-property-description": "required property added to request", - "en.messages.new-required-request-property-with-default": "added the new required request property %s with a default value", + "en.messages.new-required-request-property-with-default": "added required request property %s with a default value to media-type %s", "en.messages.new-required-request-property-with-default-description": "required property with default value added to request", - "en.messages.optional-response-header-removed": "the optional response header %s removed for the status %s", + "en.messages.optional-response-header-removed": "removed optional header %s for response status %s", "en.messages.optional-response-header-removed-description": "optional response header deleted", "en.messages.pattern-changed-warn-comment": "This is a warning because it is difficult to automatically analyze if the new pattern is a superset of the previous pattern (e.g. changed from '[0-9]+' to '[0-9]*')", "en.messages.request-body-added-optional": "added optional request body", "en.messages.request-body-added-optional-description": "optional request body added", "en.messages.request-body-added-required": "added required request body", "en.messages.request-body-added-required-description": "required request body added", - "en.messages.request-body-all-of-added": "added %s to the request body 'allOf' list", + "en.messages.request-body-all-of-added": "added %s to media-type %s of request body 'allOf' list", "en.messages.request-body-all-of-added-description": "sub-schema added to allOf in request body", - "en.messages.request-body-all-of-removed": "removed %s from the request body 'allOf' list", + "en.messages.request-body-all-of-removed": "removed %s from media-type %s of request body 'allOf' list", "en.messages.request-body-all-of-removed-description": "sub-schema deleted from allOf in request body", - "en.messages.request-body-any-of-added": "added %s to the request body 'anyOf' list", + "en.messages.request-body-any-of-added": "added %s to media-type %s of request body 'anyOf' list", "en.messages.request-body-any-of-added-description": "sub-schema added to anyOf in request body", - "en.messages.request-body-any-of-removed": "removed %s from the request body 'anyOf' list", + "en.messages.request-body-any-of-removed": "removed %s from media-type %s of request body 'anyOf' list", "en.messages.request-body-any-of-removed-description": "sub-schema deleted from anyOf in request body", - "en.messages.request-body-became-enum": "request body was restricted to a list of enum values", + "en.messages.request-body-became-enum": "media-type %s of request body was restricted to a list of enum values", "en.messages.request-body-became-enum-description": "request body restricted to enum", - "en.messages.request-body-became-not-nullable": "the request's body became not nullable", + "en.messages.request-body-became-not-nullable": "media-type %s of request body became not nullable", "en.messages.request-body-became-not-nullable-description": "null excluded as a possible value in request body", - "en.messages.request-body-became-nullable": "the request's body became nullable", + "en.messages.request-body-became-nullable": "media-type %s of request body became nullable", "en.messages.request-body-became-nullable-description": "null added as a possible value in request body", "en.messages.request-body-became-optional": "request body became optional", "en.messages.request-body-became-optional-description": "request body became optional", "en.messages.request-body-became-required": "request body became required", "en.messages.request-body-became-required-description": "request body became required", - "en.messages.request-body-default-value-added": "the request body %s default value %s was added", + "en.messages.request-body-default-value-added": "default value %s was added to media-type %s of request body", "en.messages.request-body-default-value-added-description": "request body default value set", - "en.messages.request-body-default-value-changed": "the request body %s default value changed from %s to %s", + "en.messages.request-body-default-value-changed": "default value of media-type %s of request body changed from %s to %s", "en.messages.request-body-default-value-changed-description": "request body default value modified", - "en.messages.request-body-default-value-removed": "the request body %s default value %s was removed", + "en.messages.request-body-default-value-removed": "default value %s was removed from media-type %s of request body", "en.messages.request-body-default-value-removed-description": "request body default value unset", - "en.messages.request-body-discriminator-added": "added request discriminator", + "en.messages.request-body-discriminator-added": "added discriminator to media-type %s of request body", "en.messages.request-body-discriminator-added-description": "request body discriminator added", - "en.messages.request-body-discriminator-mapping-added": "added %s mapping keys to the request discriminator", + "en.messages.request-body-discriminator-mapping-added": "added %s mapping keys to request discriminator", "en.messages.request-body-discriminator-mapping-added-description": "request body discriminator mapping added", - "en.messages.request-body-discriminator-mapping-changed": "mapped value for key %s changed from %s to %s from the request discriminator", + "en.messages.request-body-discriminator-mapping-changed": "mapped value for key %s changed from %s to %s from request discriminator", "en.messages.request-body-discriminator-mapping-changed-description": "request body discriminator mapping changed", - "en.messages.request-body-discriminator-mapping-deleted": "removed %s mapping keys from the request discriminator", + "en.messages.request-body-discriminator-mapping-deleted": "removed %s mapping keys from request discriminator", "en.messages.request-body-discriminator-mapping-deleted-description": "request body discriminator mapping deleted", - "en.messages.request-body-discriminator-property-name-changed": "request discriminator property name changed from %s to %s", + "en.messages.request-body-discriminator-property-name-changed": "discriminator property name of media-type %s of request body changed from %s to %s", "en.messages.request-body-discriminator-property-name-changed-description": "request body discriminator property name changed", - "en.messages.request-body-discriminator-removed": "removed request discriminator", + "en.messages.request-body-discriminator-removed": "removed discriminator from media-type %s of request body", "en.messages.request-body-discriminator-removed-description": "request body discriminator deleted", - "en.messages.request-body-enum-value-removed": "request body enum value removed %s", + "en.messages.request-body-enum-value-removed": "enum value %s removed from media-type %s of request body", "en.messages.request-body-enum-value-removed-description": "request body enum value deleted", - "en.messages.request-body-max-decreased": "the request's body max was decreased to %s", + "en.messages.request-body-max-decreased": "max value of media-type %s of request body was decreased from %s to %s", "en.messages.request-body-max-decreased-description": "request body max decreased", - "en.messages.request-body-max-increased": "the request's body max was increased from %s to %s", + "en.messages.request-body-max-increased": "max value of media-type %s of request body was increased from %s to %s", "en.messages.request-body-max-increased-description": "request body max increased", - "en.messages.request-body-max-length-decreased": "the request's body maxLength was decreased to %s", + "en.messages.request-body-max-length-decreased": "maxLength value of media-type %s of request body was decreased from %s to %s", "en.messages.request-body-max-length-decreased-description": "request body max length decreased", - "en.messages.request-body-max-length-increased": "the request's body maxLength was increased from %s to %s", + "en.messages.request-body-max-length-increased": "maxLength value of media-type %s of request body was increased from %s to %s", "en.messages.request-body-max-length-increased-description": "request body max length increased", - "en.messages.request-body-max-length-set": "the request's body maxLength was set to %s", + "en.messages.request-body-max-length-set": "maxLength value of media-type %s of request body was set to %s", "en.messages.request-body-max-length-set-comment": "This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification.", "en.messages.request-body-max-length-set-description": "request body max length set", - "en.messages.request-body-max-set": "the request's body max was set to %s", + "en.messages.request-body-max-set": "max value of media-type %s of request body was set to %s", "en.messages.request-body-max-set-comment": "This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification.", "en.messages.request-body-max-set-description": "request body max set", - "en.messages.request-body-media-type-added": "added the media type %s to the request body", + "en.messages.request-body-media-type-added": "added media type %s to the request body", "en.messages.request-body-media-type-added-description": "request body media-type added", - "en.messages.request-body-media-type-removed": "removed the media type %s from the request body", + "en.messages.request-body-media-type-removed": "removed media type %s from the request body", "en.messages.request-body-media-type-removed-description": "request body media-type deleted", - "en.messages.request-body-min-decreased": "the request's body min was decreased to from %s to %s", + "en.messages.request-body-min-decreased": "min value of media-type %s of request body was decreased from %s to %s", "en.messages.request-body-min-decreased-description": "request body min decreased", - "en.messages.request-body-min-increased": "the request's body min was increased to %s", + "en.messages.request-body-min-increased": "min value of media-type %s of request body was increased to %s", "en.messages.request-body-min-increased-description": "request body min increased", "en.messages.request-body-min-items increased-description": "request body min items increased", "en.messages.request-body-min-items set-description": "request body min items set", - "en.messages.request-body-min-items-decreased": "the request's body minItems was decreased from %s to %s", - "en.messages.request-body-min-items-increased": "the request's body minItems was increased to %s", - "en.messages.request-body-min-items-set": "the request's body minItems was set to %s", + "en.messages.request-body-min-items-decreased": "minItems value of media-type %s of request body was decreased from %s to %s", + "en.messages.request-body-min-items-increased": "minItems value of media-type %s of request body was increased to %s", + "en.messages.request-body-min-items-set": "minItems value of media-type %s of request body was set to %s", "en.messages.request-body-min-items-set-comment": "This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification.", - "en.messages.request-body-min-length-decreased": "the request's body minLength was decreased from %s to %s", + "en.messages.request-body-min-length-decreased": "minLength value of media-type %s of request body was decreased from %s to %s", "en.messages.request-body-min-length-decreased-description": "request body min length decreased", - "en.messages.request-body-min-length-increased": "the request's body minLength was increased from %s to %s", + "en.messages.request-body-min-length-increased": "minLength value of media-type %s of request body was increased from %s to %s", "en.messages.request-body-min-length-increased-description": "request body min length increased", - "en.messages.request-body-min-set": "the request's body min was set to %s", + "en.messages.request-body-min-set": "min value of media-type %s of request body was set to %s", "en.messages.request-body-min-set-comment": "This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification.", "en.messages.request-body-min-set-description": "request body min set", - "en.messages.request-body-one-of-added": "added %s to the request body 'oneOf' list", + "en.messages.request-body-one-of-added": "added %s to media-type %s of request body 'oneOf' list", "en.messages.request-body-one-of-added-description": "sub-schema added to oneOf in request body", - "en.messages.request-body-one-of-removed": "removed %s from the request body 'oneOf' list", + "en.messages.request-body-one-of-removed": "removed %s from media-type %s of request body 'oneOf' list", "en.messages.request-body-one-of-removed-description": "sub-schema deleted from oneOf in request body", - "en.messages.request-body-type-changed": "the request's body type/format changed from %s/%s to %s/%s", + "en.messages.request-body-type-changed": "type/format of media-type %s of request body changed from %s/%s to %s/%s", "en.messages.request-body-type-changed-description": "request body type changed", - "en.messages.request-body-type-generalized": "the request's body type/format was generalized from %s/%s to %s/%s", + "en.messages.request-body-type-generalized": "type/format of media-type %s of request body was generalized from %s/%s to %s/%s", "en.messages.request-body-type-generalized-description": "request body type generalized", - "en.messages.request-header-property-became-enum": "the %s request header's property %s was restricted to a list of enum values", + "en.messages.request-header-property-became-enum": "property %s of request header %s was restricted to a list of enum values", "en.messages.request-header-property-became-enum-description": "request header property restricted to enum", - "en.messages.request-header-property-became-required": "the %s request header's property %s became required", + "en.messages.request-header-property-became-required": "property %s of request header %s became required", "en.messages.request-header-property-became-required-description": "request header property became required", - "en.messages.request-optional-property-became-not-read-only": "the request optional property %s became not read-only", + "en.messages.request-optional-property-became-not-read-only": "request optional property %s became not read-only", "en.messages.request-optional-property-became-not-read-only-description": "request optional property became not read-only", - "en.messages.request-optional-property-became-not-write-only": "the request optional property %s became not write-only", + "en.messages.request-optional-property-became-not-write-only": "request optional property %s became not write-only", "en.messages.request-optional-property-became-not-write-only-description": "request optional property became not write-only", - "en.messages.request-optional-property-became-read-only": "the request optional property %s became read-only", + "en.messages.request-optional-property-became-read-only": "request optional property %s became read-only", "en.messages.request-optional-property-became-read-only-description": "request optional property became read-only", - "en.messages.request-optional-property-became-write-only": "the request optional property %s became write-only", + "en.messages.request-optional-property-became-write-only": "request optional property %s became write-only", "en.messages.request-optional-property-became-write-only-description": "request optional property became write-only", - "en.messages.request-parameter-became-enum": "the %s request parameter %s was restricted to a list of enum values", + "en.messages.request-parameter-became-enum": "%s request parameter %s was restricted to a list of enum values", "en.messages.request-parameter-became-enum-description": "request parameter restricted to enum", - "en.messages.request-parameter-became-optional": "the %s request parameter %s became optional", + "en.messages.request-parameter-became-optional": "%s request parameter %s became optional", "en.messages.request-parameter-became-optional-description": "request parameter became optional", - "en.messages.request-parameter-became-required": "the %s request parameter %s became required", + "en.messages.request-parameter-became-required": "%s request parameter %s became required", "en.messages.request-parameter-became-required-description": "request parameter became required", - "en.messages.request-parameter-default-value-added": "for the %s request parameter %s, default value %s was added", + "en.messages.request-parameter-default-value-added": "for %s request parameter %s, default value %s was added", "en.messages.request-parameter-default-value-added-description": "request parameter default value set", - "en.messages.request-parameter-default-value-changed": "for the %s request parameter %s, default value was changed from %s to %s", + "en.messages.request-parameter-default-value-changed": "for %s request parameter %s, default value was changed from %s to %s", "en.messages.request-parameter-default-value-changed-description": "request parameter default value changed", - "en.messages.request-parameter-default-value-removed": "for the %s request parameter %s, default value %s was removed", + "en.messages.request-parameter-default-value-removed": "for %s request parameter %s, default value %s was removed", "en.messages.request-parameter-default-value-removed-description": "request parameter default value unset", - "en.messages.request-parameter-enum-value-added": "added the new enum value %s to the %s request parameter %s", + "en.messages.request-parameter-enum-value-added": "added enum value %s to the %s request parameter %s", "en.messages.request-parameter-enum-value-added-description": "request parameter enum value added", - "en.messages.request-parameter-enum-value-removed": "removed the enum value %s from the %s request parameter %s", + "en.messages.request-parameter-enum-value-removed": "removed enum value %s from the %s request parameter %s", "en.messages.request-parameter-enum-value-removed-description": "request parameter enum value deleted", - "en.messages.request-parameter-max-decreased": "for the %s request parameter %s, the max was decreased from %s to %s", + "en.messages.request-parameter-max-decreased": "for %s request parameter %s, max was decreased from %s to %s", "en.messages.request-parameter-max-decreased-description": "request parameter max decreased", - "en.messages.request-parameter-max-increased": "for the %s request parameter %s, the max was increased from %s to %s", + "en.messages.request-parameter-max-increased": "for %s request parameter %s, max was increased from %s to %s", "en.messages.request-parameter-max-increased-description": "request parameter max increased", - "en.messages.request-parameter-max-items-decreased": "for the %s request parameter %s, the maxItems was decreased from %s to %s", + "en.messages.request-parameter-max-items-decreased": "for %s request parameter %s, maxItems was decreased from %s to %s", "en.messages.request-parameter-max-items-decreased-description": "request parameter max items decreased", - "en.messages.request-parameter-max-items-increased": "for the %s request parameter %s, the maxItems was increased from %s to %s", + "en.messages.request-parameter-max-items-increased": "for %s request parameter %s, maxItems was increased from %s to %s", "en.messages.request-parameter-max-items-increased-description": "request parameter max items increased", - "en.messages.request-parameter-max-length-decreased": "for the %s request parameter %s, the maxLength was decreased from %s to %s", + "en.messages.request-parameter-max-length-decreased": "for %s request parameter %s, maxLength was decreased from %s to %s", "en.messages.request-parameter-max-length-decreased-description": "request parameter max length decreased", - "en.messages.request-parameter-max-length-increased": "for the %s request parameter %s, the maxLength was increased from %s to %s", + "en.messages.request-parameter-max-length-increased": "for %s request parameter %s, maxLength was increased from %s to %s", "en.messages.request-parameter-max-length-increased-description": "request parameter max length increased", - "en.messages.request-parameter-max-length-set": "for the %s request parameter %s, the maxLength was set to %s", + "en.messages.request-parameter-max-length-set": "for %s request parameter %s, maxLength was set to %s", "en.messages.request-parameter-max-length-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-max-length-set-description": "request parameter max length set", - "en.messages.request-parameter-max-set": "for the %s request parameter %s, the max was set to %s", + "en.messages.request-parameter-max-set": "for %s request parameter %s, max was set to %s", "en.messages.request-parameter-max-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-max-set-description": "request parameter max set", - "en.messages.request-parameter-min-decreased": "for the %s request parameter %s, the min was decreased from %s to %s", + "en.messages.request-parameter-min-decreased": "for %s request parameter %s, min was decreased from %s to %s", "en.messages.request-parameter-min-decreased-description": "request parameter min decreased", - "en.messages.request-parameter-min-increased": "for the %s request parameter %s, the min was increased from %s to %s", + "en.messages.request-parameter-min-increased": "for %s request parameter %s, min was increased from %s to %s", "en.messages.request-parameter-min-increased-description": "request parameter min increased", - "en.messages.request-parameter-min-items-decreased": "for the %s request parameter %s, the minItems was decreased from %s to %s", + "en.messages.request-parameter-min-items-decreased": "for %s request parameter %s, minItems was decreased from %s to %s", "en.messages.request-parameter-min-items-decreased-description": "request parameter min items decreased", - "en.messages.request-parameter-min-items-increased": "for the %s request parameter %s, the minItems was increased from %s to %s", + "en.messages.request-parameter-min-items-increased": "for %s request parameter %s, minItems was increased from %s to %s", "en.messages.request-parameter-min-items-increased-description": "request parameter min items increased", - "en.messages.request-parameter-min-items-set": "for the %s request parameter %s, the minItems was set to %s", + "en.messages.request-parameter-min-items-set": "for %s request parameter %s, minItems was set to %s", "en.messages.request-parameter-min-items-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-items-set-description": "request parameter min items set", - "en.messages.request-parameter-min-length-decreased": "for the %s request parameter %s, the minLength was decreased from %s to %s", + "en.messages.request-parameter-min-length-decreased": "for %s request parameter %s, minLength was decreased from %s to %s", "en.messages.request-parameter-min-length-decreased-description": "request parameter min length decreased", - "en.messages.request-parameter-min-length-increased": "for the %s request parameter %s, the minLength was increased from %s to %s", + "en.messages.request-parameter-min-length-increased": "for %s request parameter %s, minLength was increased from %s to %s", "en.messages.request-parameter-min-length-increased-description": "request parameter min length increased", - "en.messages.request-parameter-min-set": "for the %s request parameter %s, the min was set to %s", + "en.messages.request-parameter-min-set": "for %s request parameter %s, 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 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 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-generalized": "changed the pattern of the %s request parameter %s from %s to a more general pattern %s", + "en.messages.request-parameter-pattern-generalized": "changed pattern of the %s request parameter %s from %s to a more general pattern %s", "en.messages.request-parameter-pattern-generalized-description": "request parameter pattern generalized", - "en.messages.request-parameter-pattern-removed": "removed the pattern %s from the %s request parameter %s", + "en.messages.request-parameter-pattern-removed": "removed pattern %s from the %s request parameter %s", "en.messages.request-parameter-pattern-removed-description": "request parameter pattern unset", - "en.messages.request-parameter-property-type-changed": "for the %s request parameter %s, the type/format of property %s was changed from %s/%s to %s/%s", + "en.messages.request-parameter-property-type-changed": "for %s request parameter %s, type/format of property %s was changed from %s/%s to %s/%s", "en.messages.request-parameter-property-type-changed-description": "request parameter property type changed", "en.messages.request-parameter-property-type-changed-warn-comment": "This is a warning because parameter objects can be passed in differnt ways, some of which allow this type change and others do not.", - "en.messages.request-parameter-property-type-generalized": "for the %s request parameter %s, the type/format of property %s was generalized from %s/%s to %s/%s", + "en.messages.request-parameter-property-type-generalized": "for %s request parameter %s, type/format of property %s was generalized from %s/%s to %s/%s", "en.messages.request-parameter-property-type-generalized-description": "request parameter property type generalized", - "en.messages.request-parameter-property-type-specialized": "for the %s request parameter %s, the type/format of property %s was specialized from %s/%s to %s/%s", + "en.messages.request-parameter-property-type-specialized": "for %s request parameter %s, type/format of property %s was specialized from %s/%s to %s/%s", "en.messages.request-parameter-property-type-specialized-description": "request parameter property type specialized", "en.messages.request-parameter-removed": "deleted the %s request parameter %s", "en.messages.request-parameter-removed-description": "request parameter deleted", - "en.messages.request-parameter-type-changed": "for the %s request parameter %s, the type/format was changed from %s/%s to %s/%s", + "en.messages.request-parameter-type-changed": "for %s request parameter %s, type/format was changed from %s/%s to %s/%s", "en.messages.request-parameter-type-changed-description": "request parameter type changed", - "en.messages.request-parameter-type-generalized": "for the %s request parameter %s, the type/format was generalized from %s/%s to %s/%s", + "en.messages.request-parameter-type-generalized": "for %s request parameter %s, type/format was generalized from %s/%s to %s/%s", "en.messages.request-parameter-type-generalized-description": "request parameter type generalized", - "en.messages.request-parameter-x-extensible-enum-value-removed": "removed the x-extensible-enum value %s from the %s request parameter %s", + "en.messages.request-parameter-x-extensible-enum-value-removed": "removed x-extensible-enum value %s from the %s request parameter %s", "en.messages.request-parameter-x-extensible-enum-value-removed-description": "request parameter-x-extensible-enum value deleted", - "en.messages.request-property-all-of-added": "added %s to the %s request property 'allOf' list", + "en.messages.request-property-all-of-added": "added %s to %s request property of media-type %s 'allOf' list", "en.messages.request-property-all-of-added-description": "sub-schema added to allOf in request property", - "en.messages.request-property-all-of-removed": "removed %s from the %s request property 'allOf' list", + "en.messages.request-property-all-of-removed": "removed %s from %s request property of media-type %s 'allOf' list", "en.messages.request-property-all-of-removed-description": "sub-schema deleted from allOf in request property", - "en.messages.request-property-any-of-added": "added %s to the %s request property 'anyOf' list", + "en.messages.request-property-any-of-added": "added %s to %s request property of media-type %s 'anyOf' list", "en.messages.request-property-any-of-added-description": "sub-schema deleted from anyOf in request property", - "en.messages.request-property-any-of-removed": "removed %s from the %s request property 'anyOf' list", + "en.messages.request-property-any-of-removed": "removed %s from %s request property of media-type %s 'anyOf' list", "en.messages.request-property-any-of-removed-description": "sub-schema deleted from anyOf in request property", - "en.messages.request-property-became-enum": "request property %s was restricted to a list of enum values", + "en.messages.request-property-became-enum": "request property %s of media-type %s was restricted to a list of enum values", "en.messages.request-property-became-enum-description": "request property restricted to enum", - "en.messages.request-property-became-not-nullable": "the request property %s became not nullable", + "en.messages.request-property-became-not-nullable": "request property %s of media-type %s became not nullable", "en.messages.request-property-became-not-nullable-description": "request property became not nullable", - "en.messages.request-property-became-nullable": "the request property %s became nullable", + "en.messages.request-property-became-nullable": "request property %s of media-type %s became nullable", "en.messages.request-property-became-nullable-description": "request property became nullable", - "en.messages.request-property-became-optional": "the request property %s became optional", + "en.messages.request-property-became-optional": "request property %s of media-type %s became optional", "en.messages.request-property-became-optional-description": "request property became optional", - "en.messages.request-property-became-required": "the request property %s became required", + "en.messages.request-property-became-required": "request property %s of media-type %s became required", "en.messages.request-property-became-required-description": "request property became required", - "en.messages.request-property-became-required-with-default": "the request property %s with a default value became required", + "en.messages.request-property-became-required-with-default": "request property %s with a default value became required in media-type %s", "en.messages.request-property-became-required-with-default-description": "request property with a default value became required", - "en.messages.request-property-default-value-added": "the %s request property default value %s was added", + "en.messages.request-property-default-value-added": "%s request property default value %s was added", "en.messages.request-property-default-value-added-description": "request property default value set", - "en.messages.request-property-default-value-changed": "the %s request property default value changed from %s to %s", + "en.messages.request-property-default-value-changed": "%s request property default value changed from %s to %s", "en.messages.request-property-default-value-changed-description": "request property default value changed", - "en.messages.request-property-default-value-removed": "the %s request property default value %s was removed", + "en.messages.request-property-default-value-removed": "%s request property default value %s was removed", "en.messages.request-property-default-value-removed-description": "request property default value unset", - "en.messages.request-property-discriminator-added": "added discriminator to %s request property", + "en.messages.request-property-discriminator-added": "added discriminator to property %s of media-type %s of request body", "en.messages.request-property-discriminator-added-description": "request property discriminator added", - "en.messages.request-property-discriminator-mapping-added": "added %s discriminator mapping keys to the %s request property", + "en.messages.request-property-discriminator-mapping-added": "added %s discriminator mapping keys to %s request property", "en.messages.request-property-discriminator-mapping-added-description": "request property discriminator mapping added", "en.messages.request-property-discriminator-mapping-changed": "mapped value for discriminator key %s changed from %s to %s for %s request property", "en.messages.request-property-discriminator-mapping-changed-description": "request property discriminator mapping changed", - "en.messages.request-property-discriminator-mapping-deleted": "removed %s discriminator mapping keys from the %s request property", + "en.messages.request-property-discriminator-mapping-deleted": "removed %s discriminator mapping keys from %s request property", "en.messages.request-property-discriminator-mapping-deleted-description": "request property discriminator mapping deleted", - "en.messages.request-property-discriminator-property-name-changed": "request discriminator property name changed for %s request property from %s to %s", + "en.messages.request-property-discriminator-property-name-changed": "discriminator property name of request property %s of media-type %s changed from %s to %s", "en.messages.request-property-discriminator-property-name-changed-description": "request property discriminator property name changed", - "en.messages.request-property-discriminator-removed": "removed discriminator from %s request property", + "en.messages.request-property-discriminator-removed": "removed discriminator from property %s of media-type %s of request body", "en.messages.request-property-discriminator-removed-description": "request property discriminator removed", - "en.messages.request-property-enum-value-added": "added the new %s enum value to the request property %s", + "en.messages.request-property-enum-value-added": "added %s enum value to request property %s of media type %s", "en.messages.request-property-enum-value-added-description": "request property enum value added", - "en.messages.request-property-enum-value-removed": "removed the enum value %s of the request property %s", + "en.messages.request-property-enum-value-removed": "removed enum value %s of request property %s of media-type %s", "en.messages.request-property-enum-value-removed-description": "request property enum value removed", - "en.messages.request-property-max-decreased": "the %s request property's max was decreased to %s", + "en.messages.request-property-max-decreased": "max value of request property %s of media type %s was decreased from %s to %s", "en.messages.request-property-max-decreased-description": "request property max decreased", - "en.messages.request-property-max-increased": "the %s request property's max was increased from %s to %s", + "en.messages.request-property-max-increased": "max value of request property %s of media-type %s was increased from %s to %s", "en.messages.request-property-max-increased-description": "request property max increased", - "en.messages.request-property-max-length-decreased": "the %s request property's maxLength was decreased to %s", + "en.messages.request-property-max-length-decreased": "maxLength value of request property %s of media-type %s was decreased from %s to %s", "en.messages.request-property-max-length-decreased-description": "request property max length decreased", - "en.messages.request-property-max-length-increased": "the %s request property's maxLength was increased from %s to %s", + "en.messages.request-property-max-length-increased": "maxLength value of request property %s of media-type %s was increased from %s to %s", "en.messages.request-property-max-length-increased-description": "request property max length increased", - "en.messages.request-property-max-length-set": "the %s request property's maxLength was set to %s", + "en.messages.request-property-max-length-set": "maxLength value of request property %s of media-type %s was set to %s", "en.messages.request-property-max-length-set-comment": "This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification.", "en.messages.request-property-max-length-set-description": "request property max length set", - "en.messages.request-property-max-set": "the %s request property's max was set to %s", + "en.messages.request-property-max-set": "max value of request property %s of media-type %s was set to %s", "en.messages.request-property-max-set-comment": "This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification.", "en.messages.request-property-max-set-description": "request property max set", - "en.messages.request-property-min-decreased": "the %s request property's min was decreased from %s to %s", + "en.messages.request-property-min-decreased": "min value of request property %s of media-type %s was decreased from %s to %s", "en.messages.request-property-min-decreased-description": "request property min decreased", - "en.messages.request-property-min-increased": "the %s request property's min was increased to %s", + "en.messages.request-property-min-increased": "min value of request property %s of media-type %s was increased to %s", "en.messages.request-property-min-increased-description": "request property min increased", - "en.messages.request-property-min-items-decreased": "the %s request property's minItems was decreased from %s to %s", - "en.messages.request-property-min-items-increased": "the %s request property's minItems was increased to %s", + "en.messages.request-property-min-items-decreased": "minItems value of request property %s of media-type %s was decreased from %s to %s", + "en.messages.request-property-min-items-increased": "minItems value of request property %s of media-type %s was increased to %s", "en.messages.request-property-min-items-increased-description": "request property min items increased", - "en.messages.request-property-min-items-set": "the %s request property's minItems was set to %s", + "en.messages.request-property-min-items-set": "minItems value of request property %s of media-type %s was set to %s", "en.messages.request-property-min-items-set-comment": "This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification.", "en.messages.request-property-min-items-set-description": "request property min items set", - "en.messages.request-property-min-length-decreased": "the %s request property's minLength was decreased from %s to %s", + "en.messages.request-property-min-length-decreased": "minLength value of request property %s of media-type %s was decreased from %s to %s", "en.messages.request-property-min-length-decreased-description": "request property min length decreased", - "en.messages.request-property-min-length-increased": "the %s request property's minLength was increased from %s to %s", + "en.messages.request-property-min-length-increased": "minLength value of request property %s of media-type %s was increased from %s to %s", "en.messages.request-property-min-length-increased-description": "request property min length increased", - "en.messages.request-property-min-set": "the %s request property's min was set to %s", + "en.messages.request-property-min-set": "min value of request property %s of media-type %s was set to %s", "en.messages.request-property-min-set-comment": "This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification.", "en.messages.request-property-min-set-description": "request property min set", - "en.messages.request-property-one-of-added": "added %s to the %s request property 'oneOf' list", + "en.messages.request-property-one-of-added": "added %s to %s request property of media-type %s 'oneOf' list", "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": "removed %s from %s request property of media-type %s '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 pattern %s to the request property %s of media-type %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 pattern of the request property %s of media-type %s from %s to %s", "en.messages.request-property-pattern-changed-description": "request property pattern changed", - "en.messages.request-property-pattern-generalized": "changed the pattern of the request property %s from %s to a more general pattern %s", + "en.messages.request-property-pattern-generalized": "changed pattern of the request property %s of media-type %s from %s to a more general pattern %s", "en.messages.request-property-pattern-generalized-description": "request property pattern generalized", - "en.messages.request-property-pattern-removed": "removed the pattern %s from the request property %s", + "en.messages.request-property-pattern-removed": "removed pattern %s from the request property %s of media-type %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": "removed request property %s of media-type %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": "type/format of request property %s of media-type %s changed from %s/%s to %s/%s", "en.messages.request-property-type-changed-description": "request property type changed", - "en.messages.request-property-type-generalized": "the %s request property type/format was generalized from %s/%s to %s/%s", + "en.messages.request-property-type-generalized": "type/format of request property %s of media-type %s was generalized from %s/%s to %s/%s", "en.messages.request-property-type-generalized-description": "request property type generalized", - "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 x-extensible-enum value %s of request property %s of media-type %s", "en.messages.request-property-x-extensible-enum-value-removed-description": "request property x-extensible-enum value removed", - "en.messages.request-read-only-property-enum-value-removed": "removed the enum value %s of the request read-only property %s", + "en.messages.request-read-only-property-enum-value-removed": "removed enum value %s of request read-only property %s of media-type %s", "en.messages.request-read-only-property-enum-value-removed-description": "request read-only property enum value removed", - "en.messages.request-read-only-property-max-decreased": "the %s request read-only property's max was decreased to %s", + "en.messages.request-read-only-property-max-decreased": "max value of request read-only property %s of media-type %swas decreased to %s", "en.messages.request-read-only-property-max-decreased-description": "request read-only property max decreased", - "en.messages.request-read-only-property-max-length-decreased": "the %s request read-only property's maxLength was decreased to %s", + "en.messages.request-read-only-property-max-length-decreased": "maxLength value of request read-only property %s of media-type %s was decreased from %s to %s", "en.messages.request-read-only-property-max-length-decreased-description": "request read-only property max length decreased", - "en.messages.request-read-only-property-min-increased": "the %s request read-only property's min was increased to %s", + "en.messages.request-read-only-property-min-increased": "min value of request read-only property %s of media-type %s was increased to %s", "en.messages.request-read-only-property-min-increased-description": "request read-only property min increased", - "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": "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", - "en.messages.request-required-property-became-not-write-only": "the request required property %s became not write-only", + "en.messages.request-required-property-became-not-write-only": "request required property %s became not write-only", "en.messages.request-required-property-became-not-write-only-description": "request required property became not write-only", - "en.messages.request-required-property-became-read-only": "the request required property %s became read-only", + "en.messages.request-required-property-became-read-only": "request required property %s became read-only", "en.messages.request-required-property-became-read-only-description": "request required property became read-only", - "en.messages.request-required-property-became-write-only": "the request required property %s became write-only", + "en.messages.request-required-property-became-write-only": "request required property %s became write-only", "en.messages.request-required-property-became-write-only-description": "request required property became write-only", - "en.messages.required-response-header-removed": "the mandatory response header %s removed for the status %s", + "en.messages.required-response-header-removed": "removed mandatory header %s for response status %s", "en.messages.required-response-header-removed-description": "required response header removed", - "en.messages.response-body-all-of-added": "added %s to the response body 'allOf' list for the response status %s", + "en.messages.response-body-all-of-added": "added %s to response body 'allOf' list for response status %s", "en.messages.response-body-all-of-added-description": "sub-schema added to allOf in response body", - "en.messages.response-body-all-of-removed": "removed %s from the response body 'allOf' list for the response status %s", + "en.messages.response-body-all-of-removed": "removed %s from response body 'allOf' list for response status %s", "en.messages.response-body-all-of-removed-description": "sub-schema removed from allOf in response body", - "en.messages.response-body-any-of-added": "added %s to the response body 'anyOf' list for the response status %s", + "en.messages.response-body-any-of-added": "added %s to response body 'anyOf' list for response status %s", "en.messages.response-body-any-of-added-description": "sub-schema added to anyOf in response body", - "en.messages.response-body-any-of-removed": "removed %s from the response body 'anyOf' list for the response status %s", + "en.messages.response-body-any-of-removed": "removed %s from the response body 'anyOf' list for response status %s", "en.messages.response-body-any-of-removed-description": "sub-schema removed from anyOf in response body", - "en.messages.response-body-became-nullable": "the response's body became nullable", + "en.messages.response-body-became-nullable": "response body became nullable", "en.messages.response-body-became-nullable-description": "response body became nullable", - "en.messages.response-body-default-value-added": "the response body %s default value %s was added for the status %s", + "en.messages.response-body-default-value-added": "response body %s default value %s was added for status %s", "en.messages.response-body-default-value-added-description": "response body default value set", - "en.messages.response-body-default-value-changed": "the response body %s default value changed from %s to %s for the status %s", + "en.messages.response-body-default-value-changed": "response body %s default value changed from %s to %s for status %s", "en.messages.response-body-default-value-changed-description": "response body default value changed", - "en.messages.response-body-default-value-removed": "the response body %s default value %s was removed for the status %s", + "en.messages.response-body-default-value-removed": "response body %s default value %s was removed for status %s", "en.messages.response-body-default-value-removed-description": "response body default value unset", - "en.messages.response-body-discriminator-added": "added response discriminator for the response status %s", + "en.messages.response-body-discriminator-added": "added response discriminator for response status %s", "en.messages.response-body-discriminator-added-description": "response body discriminator added", - "en.messages.response-body-discriminator-mapping-added": "added %s mapping keys to the response discriminator for the response status %s", + "en.messages.response-body-discriminator-mapping-added": "added %s mapping keys to response discriminator for response status %s", "en.messages.response-body-discriminator-mapping-added-description": "response body discriminator mapping added", - "en.messages.response-body-discriminator-mapping-changed": "mapped value for key %s changed from %s to %s from the response discriminator for the response status %s", + "en.messages.response-body-discriminator-mapping-changed": "mapped value for key %s changed from %s to %s from the response discriminator for response status %s", "en.messages.response-body-discriminator-mapping-changed-description": "response body discriminator mapping changed", - "en.messages.response-body-discriminator-mapping-deleted": "removed %s mapping keys from the response discriminator for the response status %s", + "en.messages.response-body-discriminator-mapping-deleted": "removed %s mapping keys from response discriminator for response status %s", "en.messages.response-body-discriminator-mapping-deleted-description": "response body discriminator mapping deleted", - "en.messages.response-body-discriminator-property-name-changed": "response discriminator property name changed from %s to %s for the response status %s", + "en.messages.response-body-discriminator-property-name-changed": "response discriminator property name changed from %s to %s for response status %s", "en.messages.response-body-discriminator-property-name-changed-description": "response body discriminator property name changed", - "en.messages.response-body-discriminator-removed": "removed response discriminator for the response status %s", + "en.messages.response-body-discriminator-removed": "removed response discriminator for response status %s", "en.messages.response-body-discriminator-removed-description": "response body discriminator removed", - "en.messages.response-body-max-increased": "the response's body max was increased from %s to %s", + "en.messages.response-body-max-increased": "max value of response body was increased from %s to %s", "en.messages.response-body-max-increased-description": "response body max increased", - "en.messages.response-body-max-length-increased": "the response's body maxLength was increased from %s to %s", + "en.messages.response-body-max-length-increased": "maxLength value of response body was increased from %s to %s", "en.messages.response-body-max-length-increased-description": "response body max length increased", - "en.messages.response-body-max-length-unset": "the response's body maxLength was unset from %s", + "en.messages.response-body-max-length-unset": "maxLength value of response body was unset from %s", "en.messages.response-body-max-length-unset-description": "response body max length unset", - "en.messages.response-body-min-decreased": "the response's body min was decreased from %s to %s", + "en.messages.response-body-min-decreased": "min value of response body was decreased from %s to %s", "en.messages.response-body-min-decreased-description": "response body min decreased", - "en.messages.response-body-min-items-decreased": "the response's body minItems was decreased from %s to %s", + "en.messages.response-body-min-items-decreased": "minItems value of response body was decreased from %s to %s", "en.messages.response-body-min-items-decreased-description": "response body min items decreased", - "en.messages.response-body-min-items-unset": "the response's body minItems was unset from %s", + "en.messages.response-body-min-items-unset": "minItems value of response body was unset from %s", "en.messages.response-body-min-items-unset-description": "response body min items unset", - "en.messages.response-body-min-length-decreased": "the response's body minLength was decreased from %s to %s", + "en.messages.response-body-min-length-decreased": "minLength value of response body was decreased from %s to %s", "en.messages.response-body-min-length-decreased-description": "response body min length decreased", - "en.messages.response-body-one-of-added": "added %s to the response body 'oneOf' list for the response status %s", + "en.messages.response-body-one-of-added": "added %s to response body 'oneOf' list for response status %s", "en.messages.response-body-one-of-added-description": "sub-schema added to oneOf in response body", - "en.messages.response-body-one-of-removed": "removed %s from the response body 'oneOf' list for the response status %s", + "en.messages.response-body-one-of-removed": "removed %s from response body 'oneOf' list for response status %s", "en.messages.response-body-one-of-removed-description": "sub-schema removed from oneOf in response body", - "en.messages.response-body-type-changed": "the response's body type/format changed from %s/%s to %s/%s for status %s", + "en.messages.response-body-type-changed": "body type/format changed from %s/%s to %s/%s for response status %s", "en.messages.response-body-type-changed-description": "response body type changed", - "en.messages.response-header-became-optional": "the response header %s became optional for the status %s", + "en.messages.response-header-became-optional": "header %s became optional for response status %s", "en.messages.response-header-became-optional-description": "response header became optional", - "en.messages.response-media-type-added": "added the media type %s for the response with the status %s", + "en.messages.response-media-type-added": "added media type %s for response status %s", "en.messages.response-media-type-added-description": "response media type added", - "en.messages.response-media-type-removed": "removed the media type %s for the response with the status %s", + "en.messages.response-media-type-removed": "removed media type %s for response status %s", "en.messages.response-media-type-removed-description": "response media type removed", "en.messages.response-mediatype-enum-value-removed": "response schema %s enum value removed %s", "en.messages.response-mediatype-enum-value-removed-description": "response mediatype enum value removed", - "en.messages.response-non-success-status-added": "added the non-success response with the status %s", + "en.messages.response-non-success-status-added": "added non-success response status %s", "en.messages.response-non-success-status-added-description": "response non-success status added", - "en.messages.response-non-success-status-removed": "removed the non-success response with the status %s", + "en.messages.response-non-success-status-removed": "removed non-success response status %s", "en.messages.response-non-success-status-removed-description": "response non-success status removed", - "en.messages.response-optional-property-added": "added the optional property %s to the response with the %s status", + "en.messages.response-optional-property-added": "added optional property %s to response status %s", "en.messages.response-optional-property-added-description": "response optional property added", - "en.messages.response-optional-property-became-not-read-only": "the response optional property %s became not read-only for the status %s", + "en.messages.response-optional-property-became-not-read-only": "response optional property %s became not read-only for status %s", "en.messages.response-optional-property-became-not-read-only-description": "response optional property became not read-only", - "en.messages.response-optional-property-became-not-write-only": "the response optional property %s became not write-only for the status %s", + "en.messages.response-optional-property-became-not-write-only": "response optional property %s became not write-only for status %s", "en.messages.response-optional-property-became-not-write-only-description": "response optional property became not write-only", - "en.messages.response-optional-property-became-read-only": "the response optional property %s became read-only for the status %s", + "en.messages.response-optional-property-became-read-only": "response optional property %s became read-only for status %s", "en.messages.response-optional-property-became-read-only-description": "response optional property became read-only", - "en.messages.response-optional-property-became-write-only": "the response optional property %s became write-only for the status %s", + "en.messages.response-optional-property-became-write-only": "response optional property %s became write-only for status %s", "en.messages.response-optional-property-became-write-only-description": "response optional property became write-only", - "en.messages.response-optional-property-removed": "removed the optional property %s from the response with the %s status", + "en.messages.response-optional-property-removed": "removed optional property %s from response status %s", "en.messages.response-optional-property-removed-description": "response optional property removed", - "en.messages.response-optional-write-only-property-added": "added the optional write-only property %s to the response with the %s status", + "en.messages.response-optional-write-only-property-added": "added optional write-only property %s to response status %s", "en.messages.response-optional-write-only-property-added-description": "response optional write-only property added", - "en.messages.response-optional-write-only-property-removed": "removed the optional write-only property %s from the response with the %s status", + "en.messages.response-optional-write-only-property-removed": "removed optional write-only property %s from response status %s", "en.messages.response-optional-write-only-property-removed-description": "response optional write-only property removed", - "en.messages.response-property-all-of-added": "added %s to the %s response property 'allOf' list for the response status %s", + "en.messages.response-property-all-of-added": "added %s to %s response property 'allOf' list for response status %s", "en.messages.response-property-all-of-added-description": "sub-schema added to allOf in response property", - "en.messages.response-property-all-of-removed": "removed %s from the %s response property 'allOf' list for the response status %s", + "en.messages.response-property-all-of-removed": "removed %s from %s response property 'allOf' list for response status %s", "en.messages.response-property-all-of-removed-description": "sub-schema removed from allOf in response property", - "en.messages.response-property-any-of-added": "added %s to the %s response property 'anyOf' list for the response status %s", + "en.messages.response-property-any-of-added": "added %s to %s response property 'anyOf' list for response status %s", "en.messages.response-property-any-of-added-description": "sub-schema added to anyOf in response property", - "en.messages.response-property-any-of-removed": "removed %s from the %s response property 'anyOf' list for the response status %s", + "en.messages.response-property-any-of-removed": "removed %s from %s response property 'anyOf' list for response status %s", "en.messages.response-property-any-of-removed-description": "sub-schema removed from anyOf in response property", - "en.messages.response-property-became-nullable": "the response property %s became nullable for the status %s", + "en.messages.response-property-became-nullable": "property %s became nullable for response status %s", "en.messages.response-property-became-nullable-description": "response property became nullable", - "en.messages.response-property-became-optional": "the response property %s became optional for the status %s", + "en.messages.response-property-became-optional": "property %s became optional for response status %s", "en.messages.response-property-became-optional-description": "response property became optional", - "en.messages.response-property-became-required": "the response property %s became required for the status %s", + "en.messages.response-property-became-required": "property %s became required for response status %s", "en.messages.response-property-became-required-description": "response property became required", - "en.messages.response-property-default-value-added": "the %s response's property default value %s was added for the status %s", + "en.messages.response-property-default-value-added": "added default value %s to response property %s for response status %s", "en.messages.response-property-default-value-added-description": "response property default value set", - "en.messages.response-property-default-value-changed": "the %s response's property default value changed from %s to %s for the status %s", + "en.messages.response-property-default-value-changed": "changed default value from %s to %s for property %s for response status %s", "en.messages.response-property-default-value-changed-description": "response property default value changed", - "en.messages.response-property-default-value-removed": "the %s response's property default value %s was removed for the status %s", + "en.messages.response-property-default-value-removed": "removed default value %s of property %s for response status %s", "en.messages.response-property-default-value-removed-description": "response property default value unset", - "en.messages.response-property-discriminator-added": "added discriminator to %s response property for the response status %s", + "en.messages.response-property-discriminator-added": "added discriminator to %s response property for response status %s", "en.messages.response-property-discriminator-added-description": "response property discriminator added", - "en.messages.response-property-discriminator-mapping-added": "added %s discriminator mapping keys to the %s response property for the response status %s", + "en.messages.response-property-discriminator-mapping-added": "added %s discriminator mapping keys to %s response property for response status %s", "en.messages.response-property-discriminator-mapping-added-description": "response property discriminator mapping added", - "en.messages.response-property-discriminator-mapping-changed": "mapped value for discriminator key %s changed from %s to %s for %s response property for the response status %s", + "en.messages.response-property-discriminator-mapping-changed": "mapped value for discriminator key %s changed from %s to %s for %s response property for response status %s", "en.messages.response-property-discriminator-mapping-changed-description": "response property discriminator mapping changed", - "en.messages.response-property-discriminator-mapping-deleted": "removed %s discriminator mapping keys from the %s response property for the response status %s", + "en.messages.response-property-discriminator-mapping-deleted": "removed %s discriminator mapping keys from %s response property for response status %s", "en.messages.response-property-discriminator-mapping-deleted-description": "response property discriminator mapping deleted", - "en.messages.response-property-discriminator-property-name-changed": "response discriminator property name changed for %s response property from %s to %s for the response status %s", + "en.messages.response-property-discriminator-property-name-changed": "response discriminator property name changed for %s response property from %s to %s for response status %s", "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": "removed discriminator from %s response property for 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 %s enum value to the %s response property for 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 %s enum value from %s response property for 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": "max value of %s response property was increased from %s to %s for response status %s", "en.messages.response-property-max-increased-description": "response property max increased", - "en.messages.response-property-max-length-increased": "the %s response property's maxLength was increased from %s to %s for the response status %s", + "en.messages.response-property-max-length-increased": "maxLength value of %s response property was increased from %s to %s for response status %s", "en.messages.response-property-max-length-increased-description": "response property max length increased", - "en.messages.response-property-max-length-unset": "the %s response property's maxLength was unset from %s for the response status %s", + "en.messages.response-property-max-length-unset": "maxLength value of %s response property was unset from %s for response status %s", "en.messages.response-property-max-length-unset-description": "response property max length unset", - "en.messages.response-property-min-decreased": "the %s response property's min was decreased from %s to %s for the response status %s", + "en.messages.response-property-min-decreased": "min value of %s response property was decreased from %s to %s for response status %s", "en.messages.response-property-min-decreased-description": "response property min decreased", - "en.messages.response-property-min-items-decreased": "the %s response property's minItems was decreased from %s to %s for the response status %s", + "en.messages.response-property-min-items-decreased": "minItems value of %s response property was decreased from %s to %s for response status %s", "en.messages.response-property-min-items-decreased-description": "response property min items decreased", - "en.messages.response-property-min-items-unset": "the %s response property's minItems was unset from %s for the response status %s", + "en.messages.response-property-min-items-unset": "minItems value of %s response property was unset from %s for response status %s", "en.messages.response-property-min-items-unset-description": "response property min items unset", - "en.messages.response-property-min-length-decreased": "the %s response property's minLength was decreased from %s to %s for the response status %s", + "en.messages.response-property-min-length-decreased": "minLength value of %s response property was decreased from %s to %s for response status %s", "en.messages.response-property-min-length-decreased-description": "response property min length decreased", - "en.messages.response-property-one-of-added": "added %s to the %s response property 'oneOf' list for the response status %s", + "en.messages.response-property-one-of-added": "added %s to %s response property 'oneOf' list for response status %s", "en.messages.response-property-one-of-added-description": "sub-schema added to oneOf in response property", - "en.messages.response-property-one-of-removed": "removed %s from the %s response property 'oneOf' list for the response status %s", + "en.messages.response-property-one-of-removed": "removed %s from %s response property 'oneOf' list for response status %s", "en.messages.response-property-one-of-removed-description": "sub-schema removed from oneOf in response property", - "en.messages.response-property-pattern-added": "the %s response's property pattern %s was added for the status %s", + "en.messages.response-property-pattern-added": "added pattern %s to property %s for response status %s", "en.messages.response-property-pattern-added-description": "response property pattern set", - "en.messages.response-property-pattern-changed": "the %s response's property pattern was changed from %s to %s for the status %s", + "en.messages.response-property-pattern-changed": "changed pattern from %s to %s in property %s for response status %s", "en.messages.response-property-pattern-changed-description": "response property pattern changed", - "en.messages.response-property-pattern-removed": "the %s response's property pattern %s was removed for the status %s", + "en.messages.response-property-pattern-removed": "removed pattern %s from property %s for response status %s", "en.messages.response-property-pattern-removed-description": "response property pattern unset", - "en.messages.response-property-type-changed": "the %s response's property type/format changed from %s/%s to %s/%s for status %s", + "en.messages.response-property-type-changed": "%s response property type/format changed from %s/%s to %s/%s for status %s", "en.messages.response-property-type-changed-description": "response property type changed", - "en.messages.response-required-property-added": "added the required property %s to the response with the %s status", + "en.messages.response-required-property-added": "added required property %s to response status %s", "en.messages.response-required-property-added-description": "response required property added", - "en.messages.response-required-property-became-not-read-only": "the response required property %s became not read-only for the status %s", + "en.messages.response-required-property-became-not-read-only": "response required property %s became not read-only for status %s", "en.messages.response-required-property-became-not-read-only-description": "response required property became not read-only", - "en.messages.response-required-property-became-not-write-only": "the response required property %s became not write-only for the status %s", + "en.messages.response-required-property-became-not-write-only": "response required property %s became not write-only for status %s", "en.messages.response-required-property-became-not-write-only-comment": "It is valid only if the property was always returned before the specification has been changed", "en.messages.response-required-property-became-not-write-only-description": "response required property became not write-only", - "en.messages.response-required-property-became-read-only": "the response required property %s became read-only for the status %s", + "en.messages.response-required-property-became-read-only": "response required property %s became read-only for status %s", "en.messages.response-required-property-became-read-only-description": "response required property became read-only", - "en.messages.response-required-property-became-write-only": "the response required property %s became write-only for the status %s", + "en.messages.response-required-property-became-write-only": "response required property %s became write-only for status %s", "en.messages.response-required-property-became-write-only-description": "response required property became write-only", - "en.messages.response-required-property-removed": "removed the required property %s from the response with the %s status", + "en.messages.response-required-property-removed": "removed required property %s from response status %s", "en.messages.response-required-property-removed-description": "response required property removed", - "en.messages.response-required-write-only-property-added": "added the required write-only property %s to the response with the %s status", + "en.messages.response-required-write-only-property-added": "added required write-only property %s tohe response status %s", "en.messages.response-required-write-only-property-added-description": "response required write-only property added", - "en.messages.response-required-write-only-property-removed": "removed the required write-only property %s from the response with the %s status", + "en.messages.response-required-write-only-property-removed": "removed required write-only property %s from response status %s", "en.messages.response-required-write-only-property-removed-description": "response required write-only property removed", - "en.messages.response-success-status-added": "added the success response with the status %s", + "en.messages.response-success-status-added": "added success response status %s", "en.messages.response-success-status-added-description": "response success status added", - "en.messages.response-success-status-removed": "removed the success response with the status %s", + "en.messages.response-success-status-removed": "removed success response status %s", "en.messages.response-success-status-removed-description": "response success status removed", - "en.messages.response-write-only-property-became-optional": "the response write-only property %s became optional for the status %s", + "en.messages.response-write-only-property-became-optional": "write-only property %s became optional for response status %s", "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": "write-only property %s became required for response 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 %s enum value to %s response write-only property for 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", diff --git a/checker/localizations_src/en/messages.yaml b/checker/localizations_src/en/messages.yaml index 804b7ec1..1699c807 100644 --- a/checker/localizations_src/en/messages.yaml +++ b/checker/localizations_src/en/messages.yaml @@ -5,20 +5,20 @@ request-body-added-optional: added optional 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-parameter-pattern-generalized: "changed the pattern of the %s request parameter %s from %s to a more general pattern %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" -request-property-pattern-generalized: "changed the pattern of the request property %s from %s to a more general pattern %s" -api-deprecated-sunset-parse: "failed to parse sunset date: %v" +request-parameter-pattern-added: added pattern %s to the %s request parameter %s # tested +request-parameter-pattern-removed: removed pattern %s from the %s request parameter %s # tested +request-parameter-pattern-changed: changed pattern of the %s request parameter %s from %s to %s # tested +request-parameter-pattern-generalized: changed pattern of the %s request parameter %s from %s to a more general pattern %s # tested +request-property-pattern-added: added pattern %s to the request property %s of media-type %s # tested +request-property-pattern-removed: removed pattern %s from the request property %s of media-type %s # tested +request-property-pattern-changed: changed pattern of the request property %s of media-type %s from %s to %s # tested +request-property-pattern-generalized: changed pattern of the request property %s of media-type %s from %s to a more general pattern %s # tested +api-deprecated-sunset-parse: "failed to parse sunset date: %v" # tested api-path-sunset-parse: "failed to parse sunset date: %v" -api-stability-decreased: "endpoint stability level decreased from %s to %s" +api-stability-decreased: endpoint stability level decreased from %s to %s api-invalid-stability-level: "failed to parse stability level: %v" -api-deprecated-sunset-missing: "sunset date is missing for deprecated API" -api-sunset-date-too-small: "sunset date %s is too small, must be at least %s days from now" +api-deprecated-sunset-missing: sunset date is missing for deprecated API +api-sunset-date-too-small: sunset date %s is too small, must be at least %s days from now endpoint-added: endpoint added endpoint-deprecated: endpoint deprecated endpoint-reactivated: endpoint reactivated @@ -28,262 +28,261 @@ api-removed-without-deprecation: api removed without deprecation api-removed-before-sunset: api removed before the sunset date %s api-operation-id-removed: api operation id %s removed and replaced with %s api-operation-id-added: api operation id %s was added -api-tag-removed: api tag %s removed -api-tag-added: api tag %s added -api-schema-removed: removed the schema %s +api-tag-removed: removed api tag %s +api-tag-added: added api tag %s +api-schema-removed: removed schema %s sunset-deleted: api sunset date deleted, but deprecated=true kept 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 %s days from now -new-required-request-parameter: added the new required %s request parameter %s -new-optional-request-parameter: added the new optional %s request parameter %s -new-required-request-property: added the new required request property %s -new-required-request-property-with-default: added the new required request property %s with a default value -new-optional-request-property: added the new optional request property %s -new-required-request-header-property: added the new required %s request header's property %s +new-required-request-parameter: added required %s request parameter %s +new-optional-request-parameter: added optional %s request parameter %s +new-required-request-property: added required request property %s to media-type %s # tested +new-required-request-property-with-default: added required request property %s with a default value to media-type %s # tested +new-optional-request-property: added optional request property %s to media-type %s # tested +new-required-request-header-property: added required %s request header property %s # tested request-body-became-required: request body became required request-body-became-optional: request body became optional -request-body-became-enum: request body was restricted to a list of enum values -request-body-enum-value-removed: request body enum value removed %s +request-body-became-enum: media-type %s of request body was restricted to a list of enum values # tested +request-body-enum-value-removed: enum value %s removed from media-type %s of request body # tested response-mediatype-enum-value-removed: response schema %s enum value removed %s -request-header-property-became-required: the %s request header's property %s became required -request-header-property-became-enum: the %s request header's property %s was restricted to a list of enum values -request-parameter-became-required: the %s request parameter %s became required -request-parameter-became-optional: the %s request parameter %s became optional -request-parameter-became-enum: the %s request parameter %s was restricted to a list of enum values -request-parameter-enum-value-removed: removed the enum value %s from the %s request parameter %s -request-parameter-enum-value-added: added the new enum value %s to the %s request parameter %s -pattern-changed-warn-comment: "This is a warning because it is difficult to automatically analyze if the new pattern is a superset of the previous pattern (e.g. changed from '[0-9]+' to '[0-9]*')" -request-parameter-x-extensible-enum-value-removed: removed the x-extensible-enum value %s from the %s request parameter %s -request-parameter-max-decreased: for the %s request parameter %s, the max was decreased from %s to %s -request-parameter-max-increased: for the %s request parameter %s, the max was increased from %s to %s -request-parameter-default-value-added: for the %s request parameter %s, default value %s was added -request-parameter-default-value-changed: for the %s request parameter %s, default value was changed from %s to %s -request-parameter-default-value-removed: for the %s request parameter %s, default value %s was removed -request-parameter-max-length-decreased: for the %s request parameter %s, the maxLength was decreased from %s to %s -request-parameter-max-length-increased: for the %s request parameter %s, the maxLength was increased from %s to %s -request-parameter-min-length-increased: for the %s request parameter %s, the minLength was increased from %s to %s -request-parameter-min-length-decreased: for the %s request parameter %s, the minLength was decreased from %s to %s -request-parameter-max-length-set: for the %s request parameter %s, the maxLength was set to %s -request-parameter-max-length-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." -request-parameter-max-set: for the %s request parameter %s, the max was set to %s -request-parameter-max-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." -request-parameter-min-increased: for the %s request parameter %s, the min was increased from %s to %s -request-parameter-min-decreased: for the %s request parameter %s, the min was decreased from %s to %s -request-parameter-max-items-decreased: for the %s request parameter %s, the maxItems was decreased from %s to %s -request-parameter-max-items-increased: for the %s request parameter %s, the maxItems was increased from %s to %s -request-parameter-min-items-increased: for the %s request parameter %s, the minItems was increased from %s to %s -request-parameter-min-items-decreased: for the %s request parameter %s, the minItems was decreased from %s to %s -request-parameter-min-items-set: for the %s request parameter %s, the minItems was set to %s +request-header-property-became-required: property %s of request header %s became required # tested +request-header-property-became-enum: property %s of request header %s was restricted to a list of enum values # tested +request-parameter-became-required: "%s request parameter %s became required" # tested +request-parameter-became-optional: "%s request parameter %s became optional" # tested +request-parameter-became-enum: "%s request parameter %s was restricted to a list of enum values" +request-parameter-enum-value-removed: removed enum value %s from the %s request parameter %s +request-parameter-enum-value-added: added enum value %s to the %s request parameter %s +request-parameter-x-extensible-enum-value-removed: removed x-extensible-enum value %s from the %s request parameter %s +request-parameter-max-decreased: for %s request parameter %s, max was decreased from %s to %s +request-parameter-max-increased: for %s request parameter %s, max was increased from %s to %s +request-parameter-default-value-added: for %s request parameter %s, default value %s was added +request-parameter-default-value-changed: for %s request parameter %s, default value was changed from %s to %s +request-parameter-default-value-removed: for %s request parameter %s, default value %s was removed +request-parameter-max-length-decreased: for %s request parameter %s, maxLength was decreased from %s to %s +request-parameter-max-length-increased: for %s request parameter %s, maxLength was increased from %s to %s +request-parameter-min-length-increased: for %s request parameter %s, minLength was increased from %s to %s +request-parameter-min-length-decreased: for %s request parameter %s, minLength was decreased from %s to %s +request-parameter-max-length-set: for %s request parameter %s, maxLength was set to %s +request-parameter-max-set: for %s request parameter %s, max was set to %s +request-parameter-min-increased: for %s request parameter %s, min was increased from %s to %s +request-parameter-min-decreased: for %s request parameter %s, min was decreased from %s to %s +request-parameter-max-items-decreased: for %s request parameter %s, maxItems was decreased from %s to %s +request-parameter-max-items-increased: for %s request parameter %s, maxItems was increased from %s to %s +request-parameter-min-items-increased: for %s request parameter %s, minItems was increased from %s to %s +request-parameter-min-items-decreased: for %s request parameter %s, minItems was decreased from %s to %s +request-parameter-min-items-set: for %s request parameter %s, minItems was set to %s +request-parameter-min-set: for %s request parameter %s, min was set to %s +request-parameter-type-changed: for %s request parameter %s, type/format was changed from %s/%s to %s/%s +request-parameter-type-generalized: for %s request parameter %s, type/format was generalized from %s/%s to %s/%s +request-parameter-property-type-changed: for %s request parameter %s, type/format of property %s was changed from %s/%s to %s/%s +request-parameter-property-type-generalized: for %s request parameter %s, type/format of property %s was generalized from %s/%s to %s/%s +request-parameter-property-type-specialized: for %s request parameter %s, type/format of property %s was specialized from %s/%s to %s/%s +new-request-path-parameter: added path request parameter %s +request-property-became-required: request property %s of media-type %s became required # tested +request-property-became-required-with-default: request property %s with a default value became required in media-type %s # tested +request-property-became-optional: request property %s of media-type %s became optional # tested +request-property-became-not-nullable: request property %s of media-type %s became not nullable +request-body-became-not-nullable: media-type %s of request body became not nullable +request-property-became-nullable: request property %s of media-type %s became nullable +request-body-became-nullable: media-type %s of request body became nullable +request-property-became-enum: request property %s of media-type %s was restricted to a list of enum values +request-property-enum-value-removed: removed enum value %s of request property %s of media-type %s +request-read-only-property-enum-value-removed: removed enum value %s of request read-only property %s of media-type %s +request-property-enum-value-added: added %s enum value to request property %s of media type %s +request-body-max-decreased: max value of media-type %s of request body was decreased from %s to %s +request-property-max-decreased: max value of request property %s of media type %s was decreased from %s to %s +request-read-only-property-max-decreased: max value of request read-only property %s of media-type %swas decreased to %s +request-body-max-length-decreased: maxLength value of media-type %s of request body was decreased from %s to %s +request-property-max-length-decreased: maxLength value of request property %s of media-type %s was decreased from %s to %s +request-read-only-property-max-length-decreased: maxLength value of request read-only property %s of media-type %s was decreased from %s to %s +request-body-min-length-increased: minLength value of media-type %s of request body was increased from %s to %s +request-property-min-length-increased: minLength value of request property %s of media-type %s was increased from %s to %s +request-body-min-length-decreased: minLength value of media-type %s of request body was decreased from %s to %s +request-property-min-length-decreased: minLength value of request property %s of media-type %s was decreased from %s to %s +request-body-max-increased: max value of media-type %s of request body was increased from %s to %s +request-property-max-increased: max value of request property %s of media-type %s was increased from %s to %s +request-body-max-length-increased: maxLength value of media-type %s of request body was increased from %s to %s +request-property-max-length-increased: maxLength value of request property %s of media-type %s was increased from %s to %s +request-body-max-length-set: maxLength value of media-type %s of request body was set to %s +request-property-max-length-set: maxLength value of request property %s of media-type %s was set to %s +request-body-max-set: max value of media-type %s of request body was set to %s +request-property-max-set: max value of request property %s of media-type %s was set to %s +request-body-min-increased: min value of media-type %s of request body was increased to %s +request-property-min-increased: min value of request property %s of media-type %s was increased to %s +request-read-only-property-min-increased: min value of request read-only property %s of media-type %s was increased to %s +request-body-min-items-increased: minItems value of media-type %s of request body was increased to %s +request-property-min-items-increased: minItems value of request property %s of media-type %s was increased to %s +request-body-min-decreased: min value of media-type %s of request body was decreased from %s to %s +request-property-min-decreased: min value of request property %s of media-type %s was decreased from %s to %s +request-body-min-items-decreased: minItems value of media-type %s of request body was decreased from %s to %s +request-property-min-items-decreased: minItems value of request property %s of media-type %s was decreased from %s to %s +request-body-min-items-set: minItems value of media-type %s of request body was set to %s +request-property-min-items-set: minItems value of request property %s of media-type %s was set to %s +request-body-min-set: min value of media-type %s of request body was set to %s +request-property-min-set: min value of request property %s of media-type %s was set to %s +request-property-removed: removed request property %s of media-type %s +request-body-type-changed: type/format of media-type %s of request body changed from %s/%s to %s/%s +request-body-type-generalized: type/format of media-type %s of request body was generalized from %s/%s to %s/%s +request-property-type-changed: type/format of request property %s of media-type %s changed from %s/%s to %s/%s +request-property-type-generalized: type/format of request property %s of media-type %s was generalized from %s/%s to %s/%s +request-property-x-extensible-enum-value-removed: removed x-extensible-enum value %s of request property %s of media-type %s +response-header-became-optional: header %s became optional for response status %s +required-response-header-removed: removed mandatory header %s for response status %s +optional-response-header-removed: removed optional header %s for response status %s +response-media-type-removed: removed media type %s for response status %s +response-media-type-added: added media type %s for response status %s +response-optional-property-removed: removed optional property %s from response status %s +response-property-became-optional: property %s became optional for response status %s +response-property-became-nullable: property %s became nullable for response status %s +response-body-became-nullable: response body became nullable +response-property-enum-value-added: added %s enum value to the %s response property for 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 %s enum value from %s response property for response status %s +response-body-max-length-increased: maxLength value of response body was increased from %s to %s +response-property-max-length-increased: maxLength value of %s response property was increased from %s to %s for response status %s +response-body-max-length-unset: maxLength value of response body was unset from %s +response-property-max-length-unset: maxLength value of %s response property was unset from %s for response status %s +response-body-min-items-decreased: minItems value of response body was decreased from %s to %s +response-property-min-items-decreased: minItems value of %s response property was decreased from %s to %s for response status %s +response-body-min-items-unset: minItems value of response body was unset from %s +response-property-min-items-unset: minItems value of %s response property was unset from %s for response status %s +response-body-min-length-decreased: minLength value of response body was decreased from %s to %s +response-property-min-length-decreased: minLength value of %s response property was decreased from %s to %s for response status %s +response-body-type-changed: body type/format changed from %s/%s to %s/%s for response status %s +response-property-type-changed: "%s response property type/format changed from %s/%s to %s/%s for status %s" +response-required-property-became-not-write-only: response required property %s became not write-only for status %s +response-required-property-became-not-write-only-comment: It is valid only if the property was always returned before the specification has been changed +response-required-property-removed: removed required property %s from response status %s +response-required-property-added: added required property %s to response status %s +response-success-status-removed: removed success response status %s +response-non-success-status-removed: removed non-success response status %s +response-success-status-added: added success response status %s +response-non-success-status-added: added non-success response status %s +response-body-max-increased: max value of response body was increased from %s to %s +response-property-max-increased: max value of %s response property was increased from %s to %s for response status %s +response-body-min-decreased: min value of response body was decreased from %s to %s +response-property-min-decreased: min value of %s response property was decreased from %s to %s for response status %s +api-security-added: endpoint scheme security %s was added +api-security-removed: removed endpoint scheme security %s # tested +api-global-security-added: security scheme %s was added +api-global-security-removed: removed security scheme %s # tested +api-global-security-scope-removed: removed security scope %s from global security scheme %s +api-global-security-scope-added: security scope %s was added to global security scheme %s +api-security-scope-removed: removed security scope %s from endpoint security scheme %s # tested +api-security-scope-added: security scope %s was added to endpoint security scheme %s +api-security-component-type-changed: component security scheme %s type changed from %s to %s +api-security-component-oauth-url-changed: component security scheme %s oauth url changed from %s to %s +api-security-component-oauth-token-url-changed: component security scheme %s oauth token url changed from %s to %s +api-security-component-added: component security scheme %s was added +api-security-component-removed: removed component security scheme %s # tested +api-security-component-oauth-scope-added: component security scheme %s oauth scope %s was added +api-security-component-oauth-scope-removed: removed component security scheme %s oauth scope %s # tested +api-security-component-oauth-scope-changed: component security scheme %s oauth scope %s was updated from %s to %s +response-optional-property-added: added optional property %s to response status %s +response-optional-write-only-property-added: added optional write-only property %s to response status %s +response-optional-write-only-property-removed: removed optional write-only property %s from response status %s +response-required-write-only-property-added: added required write-only property %s tohe response status %s +response-required-write-only-property-removed: removed required write-only property %s from response status %s +response-write-only-property-became-optional: write-only property %s became optional for response status %s +response-property-became-required: property %s became required for response status %s +response-write-only-property-became-required: write-only property %s became required for response status %s +request-body-media-type-removed: removed media type %s from the request body +request-body-media-type-added: added media type %s to the request body +response-write-only-property-enum-value-added: added %s enum value to %s response write-only property for response status %s +response-required-property-became-write-only: response required property %s became write-only for status %s +response-required-property-became-read-only: response required property %s became read-only for status %s +response-required-property-became-not-read-only: response required property %s became not read-only for status %s +response-optional-property-became-write-only: response optional property %s became write-only for status %s +response-optional-property-became-read-only: response optional property %s became read-only for status %s +response-optional-property-became-not-write-only: response optional property %s became not write-only for status %s +response-optional-property-became-not-read-only: response optional property %s became not read-only for status %s +response-property-pattern-changed: changed pattern from %s to %s in property %s for response status %s # tested +response-property-pattern-added: added pattern %s to property %s for response status %s # tested +response-property-pattern-removed: removed pattern %s from property %s for response status %s # tested +response-property-default-value-added: added default value %s to response property %s for response status %s +response-property-default-value-changed: changed default value from %s to %s for property %s for response status %s +response-property-default-value-removed: removed default value %s of property %s for response status %s +response-body-default-value-added: response body %s default value %s was added for status %s +response-body-default-value-changed: response body %s default value changed from %s to %s for status %s +response-body-default-value-removed: response body %s default value %s was removed for status %s +request-property-default-value-added: "%s request property default value %s was added" +request-property-default-value-changed: "%s request property default value changed from %s to %s" +request-property-default-value-removed: "%s request property default value %s was removed" +request-body-default-value-added: default value %s was added to media-type %s of request body +request-body-default-value-changed: default value of media-type %s of request body changed from %s to %s +request-body-default-value-removed: default value %s was removed from media-type %s of request body +request-body-any-of-added: added %s to media-type %s of request body 'anyOf' list +request-body-any-of-removed: removed %s from media-type %s of request body 'anyOf' list +request-property-any-of-added: added %s to %s request property of media-type %s 'anyOf' list +request-property-any-of-removed: removed %s from %s request property of media-type %s 'anyOf' list +response-body-any-of-added: added %s to response body 'anyOf' list for response status %s +response-body-any-of-removed: removed %s from the response body 'anyOf' list for response status %s +response-property-any-of-added: added %s to %s response property 'anyOf' list for response status %s +response-property-any-of-removed: removed %s from %s response property 'anyOf' list for response status %s +request-body-one-of-added: added %s to media-type %s of request body 'oneOf' list +request-body-one-of-removed: removed %s from media-type %s of request body 'oneOf' list +request-property-one-of-added: added %s to %s request property of media-type %s 'oneOf' list +request-property-one-of-removed: removed %s from %s request property of media-type %s 'oneOf' list +response-body-one-of-added: added %s to response body 'oneOf' list for response status %s +response-body-one-of-removed: removed %s from response body 'oneOf' list for response status %s +response-property-one-of-added: added %s to %s response property 'oneOf' list for response status %s +response-property-one-of-removed: removed %s from %s response property 'oneOf' list for response status %s +request-body-all-of-added: added %s to media-type %s of request body 'allOf' list +request-body-all-of-removed: removed %s from media-type %s of request body 'allOf' list +request-property-all-of-added: added %s to %s request property of media-type %s 'allOf' list +request-property-all-of-removed: removed %s from %s request property of media-type %s 'allOf' list +response-body-all-of-added: added %s to response body 'allOf' list for response status %s +response-body-all-of-removed: removed %s from response body 'allOf' list for response status %s +response-property-all-of-added: added %s to %s response property 'allOf' list for response status %s +response-property-all-of-removed: removed %s from %s response property 'allOf' list for response status %s +response-body-discriminator-added: added response discriminator for response status %s +response-property-discriminator-added: added discriminator to %s response property for response status %s +response-body-discriminator-removed: removed response discriminator for response status %s +response-property-discriminator-removed: removed discriminator from %s response property for response status %s +response-body-discriminator-property-name-changed: response discriminator property name changed from %s to %s for response status %s +response-property-discriminator-property-name-changed: response discriminator property name changed for %s response property from %s to %s for response status %s +response-body-discriminator-mapping-added: added %s mapping keys to response discriminator for response status %s +response-property-discriminator-mapping-added: added %s discriminator mapping keys to %s response property for response status %s +response-body-discriminator-mapping-deleted: removed %s mapping keys from response discriminator for response status %s +response-property-discriminator-mapping-deleted: removed %s discriminator mapping keys from %s response property for response status %s +response-body-discriminator-mapping-changed: mapped value for key %s changed from %s to %s from the response discriminator for response status %s +response-property-discriminator-mapping-changed: mapped value for discriminator key %s changed from %s to %s for %s response property for response status %s +request-body-discriminator-added: added discriminator to media-type %s of request body +request-property-discriminator-added: added discriminator to property %s of media-type %s of request body +request-body-discriminator-removed: removed discriminator from media-type %s of request body +request-property-discriminator-removed: removed discriminator from property %s of media-type %s of request body +request-body-discriminator-property-name-changed: discriminator property name of media-type %s of request body changed from %s to %s +request-property-discriminator-property-name-changed: discriminator property name of request property %s of media-type %s changed from %s to %s +request-body-discriminator-mapping-added: added %s mapping keys to request discriminator +request-property-discriminator-mapping-added: added %s discriminator mapping keys to %s request property +request-body-discriminator-mapping-deleted: removed %s mapping keys from request discriminator +request-property-discriminator-mapping-deleted: removed %s discriminator mapping keys from %s request property +request-body-discriminator-mapping-changed: mapped value for key %s changed from %s to %s from request discriminator +request-property-discriminator-mapping-changed: mapped value for discriminator key %s changed from %s to %s for %s request property +request-required-property-became-read-only: request required property %s became read-only +request-required-property-became-not-read-only: request required property %s became not read-only +request-optional-property-became-write-only: request optional property %s became write-only +request-optional-property-became-read-only: request optional property %s became read-only +request-optional-property-became-not-write-only: request optional property %s became not write-only +request-optional-property-became-not-read-only: request optional property %s became not read-only +request-required-property-became-write-only: request required property %s became write-only +request-required-property-became-not-write-only: request required property %s became not write-only +new-required-request-default-parameter-to-existing-path: added required %s request parameter %s to all path's operations +new-optional-request-default-parameter-to-existing-path: added optional %s request parameter %s to all path's operations +# warnings +pattern-changed-warn-comment: This is a warning because it is difficult to automatically analyze if the new pattern is a superset of the previous pattern (e.g. changed from '[0-9]+' to '[0-9]*') +request-parameter-max-length-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. +request-parameter-max-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. request-parameter-min-items-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. -request-parameter-min-set: for the %s request parameter %s, the min was set to %s 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. -request-parameter-type-changed: for the %s request parameter %s, the type/format was changed from %s/%s to %s/%s -request-parameter-type-generalized: for the %s request parameter %s, the type/format was generalized from %s/%s to %s/%s -request-parameter-property-type-changed: for the %s request parameter %s, the type/format of property %s was changed from %s/%s to %s/%s request-parameter-property-type-changed-warn-comment: This is a warning because parameter objects can be passed in differnt ways, some of which allow this type change and others do not. -request-parameter-property-type-generalized: for the %s request parameter %s, the type/format of property %s was generalized from %s/%s to %s/%s -request-parameter-property-type-specialized: for the %s request parameter %s, the type/format of property %s was specialized from %s/%s to %s/%s -new-request-path-parameter: added the new path request parameter %s -request-property-became-required: the request property %s became required -request-property-became-required-with-default: the request property %s with a default value became required -request-property-became-optional: the request property %s became optional -request-property-became-not-nullable: the request property %s became not nullable -request-body-became-not-nullable: the request's body became not nullable -request-property-became-nullable: the request property %s became nullable -request-body-became-nullable: the request's body became nullable -request-property-became-enum: request property %s was restricted to a list of enum values -request-property-enum-value-removed: removed the enum value %s of the request property %s -request-read-only-property-enum-value-removed: removed the enum value %s of the request read-only property %s -request-property-enum-value-added: added the new %s enum value to the request property %s -request-body-max-decreased: the request's body max was decreased to %s -request-property-max-decreased: the %s request property's max was decreased to %s -request-read-only-property-max-decreased: the %s request read-only property's max was decreased to %s -request-body-max-length-decreased: the request's body maxLength was decreased to %s -request-property-max-length-decreased: the %s request property's maxLength was decreased to %s -request-read-only-property-max-length-decreased: the %s request read-only property's maxLength was decreased to %s -request-body-min-length-increased: the request's body minLength was increased from %s to %s -request-property-min-length-increased: the %s request property's minLength was increased from %s to %s -request-body-min-length-decreased: the request's body minLength was decreased from %s to %s -request-property-min-length-decreased: the %s request property's minLength was decreased from %s to %s -request-body-max-increased: the request's body max was increased from %s to %s -request-property-max-increased: the %s request property's max was increased from %s to %s -request-body-max-length-increased: the request's body maxLength was increased from %s to %s -request-property-max-length-increased: the %s request property's maxLength was increased from %s to %s -request-body-max-length-set: the request's body maxLength was set to %s request-body-max-length-set-comment: This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification. -request-property-max-length-set: the %s request property's maxLength was set to %s request-property-max-length-set-comment: This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification. -request-body-max-set: the request's body max was set to %s request-body-max-set-comment: This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification. -request-property-max-set: the %s request property's max was set to %s request-property-max-set-comment: This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification. -request-body-min-increased: the request's body min was increased to %s -request-property-min-increased: the %s request property's min was increased to %s -request-read-only-property-min-increased: the %s request read-only property's min was increased to %s -request-body-min-items-increased: the request's body minItems was increased to %s -request-property-min-items-increased: the %s request property's minItems was increased to %s -request-body-min-decreased: the request's body min was decreased to from %s to %s -request-property-min-decreased: the %s request property's min was decreased from %s to %s -request-body-min-items-decreased: the request's body minItems was decreased from %s to %s -request-property-min-items-decreased: the %s request property's minItems was decreased from %s to %s -request-body-min-items-set: the request's body minItems was set to %s request-body-min-items-set-comment: This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification. -request-property-min-items-set: the %s request property's minItems was set to %s request-property-min-items-set-comment: This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification. -request-body-min-set: the request's body min was set to %s request-body-min-set-comment: This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification. -request-property-min-set: the %s request property's min was set to %s request-property-min-set-comment: This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification. -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-body-type-generalized: the request's body type/format was generalized 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-type-generalized: the %s request property type/format was generalized 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 -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 -response-media-type-removed: removed the media type %s for the response with the status %s -response-media-type-added: added the media type %s for the response with the status %s -response-optional-property-removed: removed the optional property %s from the response with the %s status -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-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-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 -response-property-max-length-unset: the %s response property's maxLength was unset from %s for the response status %s -response-body-min-items-decreased: the response's body minItems was decreased from %s to %s -response-property-min-items-decreased: the %s response property's minItems was decreased from %s to %s for the response status %s -response-body-min-items-unset: the response's body minItems was unset from %s -response-property-min-items-unset: the %s response property's minItems was unset from %s for the response status %s -response-body-min-length-decreased: the response's body minLength was decreased from %s to %s -response-property-min-length-decreased: the %s response property's minLength was decreased from %s to %s for the response status %s -response-body-type-changed: the response's body type/format changed from %s/%s to %s/%s for status %s -response-property-type-changed: the %s response's property type/format changed from %s/%s to %s/%s for status %s -response-required-property-became-not-write-only: the response required property %s became not write-only for the status %s -response-required-property-became-not-write-only-comment: It is valid only if the property was always returned before the specification has been changed -response-required-property-removed: removed the required property %s from the response with the %s status -response-required-property-added: added the required property %s to the response with the %s status -response-success-status-removed: removed the success response with the status %s -response-non-success-status-removed: removed the non-success response with the status %s -response-success-status-added: added the success response with the status %s -response-non-success-status-added: added the non-success response with the status %s -response-body-max-increased: the response's body max was increased from %s to %s -response-property-max-increased: the %s response property's max was increased from %s to %s for the response status %s -response-body-min-decreased: the response's body min was decreased from %s to %s -response-property-min-decreased: the %s response property's min was decreased from %s to %s for the response status %s -api-security-added: the endpoint scheme security %s was added to the API -api-security-removed: the endpoint scheme security %s was removed from the API -api-security-updated: the endpoint scheme security %s was updated from %s to %s -api-global-security-added: the security scheme %s was added to the API -api-global-security-removed: the security scheme %s was removed from the API -api-global-security-scope-removed: the security scope %s was removed from the global security scheme %s -api-global-security-scope-added: the security scope %s was added to the global security scheme %s -api-security-scope-removed: the security scope %s was removed from the endpoint's security scheme %s -api-stability-decreased-description: endpoint stability level decreased -api-security-scope-added: the security scope %s was added to the endpoint's security scheme %s -api-security-component-type-changed: the component security scheme %s type changed from %s to %s -api-security-component-oauth-url-changed: the component security scheme %s oauth url changed from %s to %s -api-security-component-oauth-token-url-changed: the component security scheme %s oauth token url changed from %s to %s -api-security-component-added: the component security scheme %s was added -api-security-component-removed: the component security scheme %s was removed -api-security-component-oauth-scope-added: the component security scheme %s oauth scope %s was added -api-security-component-oauth-scope-removed: the component security scheme %s oauth scope %s was removed -api-security-component-oauth-scope-changed: the component security scheme %s oauth scope %s was updated from %s to %s -response-optional-property-added: added the optional property %s to the response with the %s status -response-optional-write-only-property-added: added the optional write-only property %s to the response with the %s status -response-optional-write-only-property-removed: removed the optional write-only property %s from the response with the %s status -response-required-write-only-property-added: added the required write-only property %s to the response with the %s status -response-required-write-only-property-removed: removed the required write-only property %s from the response with the %s status -response-write-only-property-became-optional: the response write-only property %s became optional for the status %s -response-property-became-required: the response property %s became required for the status %s -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-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 -response-optional-property-became-write-only: the response optional property %s became write-only for the status %s -response-optional-property-became-read-only: the response optional property %s became read-only for the status %s -response-optional-property-became-not-write-only: the response optional property %s became not write-only for the status %s -response-optional-property-became-not-read-only: the response optional property %s became not read-only for the status %s -response-property-pattern-changed: the %s response's property pattern was changed from %s to %s for the status %s -response-property-pattern-added: the %s response's property pattern %s was added for the status %s -response-property-pattern-removed: the %s response's property pattern %s was removed for the status %s -response-property-default-value-added: the %s response's property default value %s was added for the status %s -response-property-default-value-changed: the %s response's property default value changed from %s to %s for the status %s -response-property-default-value-removed: the %s response's property default value %s was removed for the status %s -response-body-default-value-added: the response body %s default value %s was added for the status %s -response-body-default-value-changed: the response body %s default value changed from %s to %s for the status %s -response-body-default-value-removed: the response body %s default value %s was removed for the status %s -request-property-default-value-added: the %s request property default value %s was added -request-property-default-value-changed: the %s request property default value changed from %s to %s -request-property-default-value-removed: the %s request property default value %s was removed -request-body-default-value-added: the request body %s default value %s was added -request-body-default-value-changed: the request body %s default value changed from %s to %s -request-body-default-value-removed: the request body %s default value %s was removed -request-body-any-of-added: added %s to the request body 'anyOf' list -request-body-any-of-removed: removed %s from the request body 'anyOf' list -request-property-any-of-added: added %s to the %s request property 'anyOf' list -request-property-any-of-removed: removed %s from the %s request property 'anyOf' list -response-body-any-of-added: added %s to the response body 'anyOf' list for the response status %s -response-body-any-of-removed: removed %s from the response body 'anyOf' list for the response status %s -response-property-any-of-added: added %s to the %s response property 'anyOf' list for the response status %s -response-property-any-of-removed: removed %s from the %s response property 'anyOf' list for the response status %s -request-body-one-of-added: added %s to the request body 'oneOf' list -request-body-one-of-removed: removed %s from the request body 'oneOf' list -request-property-one-of-added: added %s to the %s request property 'oneOf' list -request-property-one-of-removed: removed %s from the %s request property 'oneOf' list -response-body-one-of-added: added %s to the response body 'oneOf' list for the response status %s -response-body-one-of-removed: removed %s from the response body 'oneOf' list for the response status %s -response-property-one-of-added: added %s to the %s response property 'oneOf' list for the response status %s -response-property-one-of-removed: removed %s from the %s response property 'oneOf' list for the response status %s -request-body-all-of-added: added %s to the request body 'allOf' list -request-body-all-of-removed: removed %s from the request body 'allOf' list -request-property-all-of-added: added %s to the %s request property 'allOf' list -request-property-all-of-removed: removed %s from the %s request property 'allOf' list -response-body-all-of-added: added %s to the response body 'allOf' list for the response status %s -response-body-all-of-removed: removed %s from the response body 'allOf' list for the response status %s -response-property-all-of-added: added %s to the %s response property 'allOf' list for the response status %s -response-property-all-of-removed: removed %s from the %s response property 'allOf' list for the response status %s -response-body-discriminator-added: added response discriminator for the response status %s -response-property-discriminator-added: added discriminator to %s response property for the response status %s -response-body-discriminator-removed: removed response discriminator for the response status %s -response-property-discriminator-removed: removed discriminator from %s response property for the response status %s -response-body-discriminator-property-name-changed: response discriminator property name changed from %s to %s for the response status %s -response-property-discriminator-property-name-changed: response discriminator property name changed for %s response property from %s to %s for the response status %s -response-body-discriminator-mapping-added: added %s mapping keys to the response discriminator for the response status %s -response-property-discriminator-mapping-added: added %s discriminator mapping keys to the %s response property for the response status %s -response-body-discriminator-mapping-deleted: removed %s mapping keys from the response discriminator for the response status %s -response-property-discriminator-mapping-deleted: removed %s discriminator mapping keys from the %s response property for the response status %s -response-body-discriminator-mapping-changed: mapped value for key %s changed from %s to %s from the response discriminator for the response status %s -response-property-discriminator-mapping-changed: mapped value for discriminator key %s changed from %s to %s for %s response property for the response status %s -request-body-discriminator-added: added request discriminator -request-property-discriminator-added: added discriminator to %s request property -request-body-discriminator-removed: removed request discriminator -request-property-discriminator-removed: removed discriminator from %s request property -request-body-discriminator-property-name-changed: request discriminator property name changed from %s to %s -request-property-discriminator-property-name-changed: request discriminator property name changed for %s request property from %s to %s -request-body-discriminator-mapping-added: added %s mapping keys to the request discriminator -request-property-discriminator-mapping-added: added %s discriminator mapping keys to the %s request property -request-body-discriminator-mapping-deleted: removed %s mapping keys from the request discriminator -request-property-discriminator-mapping-deleted: removed %s discriminator mapping keys from the %s request property -request-body-discriminator-mapping-changed: mapped value for key %s changed from %s to %s from the request discriminator -request-property-discriminator-mapping-changed: mapped value for discriminator key %s changed from %s to %s for %s request property -request-required-property-became-read-only: the request required property %s became read-only -request-required-property-became-not-read-only: the request required property %s became not read-only -request-optional-property-became-write-only: the request optional property %s became write-only -request-optional-property-became-read-only: the request optional property %s became read-only -request-optional-property-became-not-write-only: the request optional property %s became not write-only -request-optional-property-became-not-read-only: the request optional property %s became not read-only -request-required-property-became-write-only: the request required property %s became write-only -request-required-property-became-not-write-only: the request required property %s became not write-only -new-required-request-default-parameter-to-existing-path: added the new required %s request parameter %s to all path's operations -new-optional-request-default-parameter-to-existing-path: added the new optional %s request parameter %s to all path's operations # descriptions request-body-added-required-description: required request body added request-body-added-optional-description: optional request body added @@ -299,6 +298,7 @@ api-operation-id-removed-description: operation ID deleted from an endpoint api-path-removed-before-sunset-description: path and endpoint deleted before sunset date api-path-removed-without-deprecation-description: path and endpoint deleted without deprecation api-path-sunset-parse-description: path and endpoint deleted with invalid or missing sunset date +api-stability-decreased-description: endpoint stability level decreased api-removed-before-sunset-description: endpoint deleted before sunset date api-removed-without-deprecation-description: endpoint deleted without deprecation api-schema-removed-description: schema deleted from components/schemas diff --git a/data/ignore-err-example.txt b/data/ignore-err-example.txt index 1f47e84d..a982ea3e 100644 --- a/data/ignore-err-example.txt +++ b/data/ignore-err-example.txt @@ -1,4 +1,4 @@ -GET /api/{domain}/{project}/badges/security-score removed the success response with the status '200' -in components removed the schema 'rules' -removed the schema 'network-policies' from components +GET /api/{domain}/{project}/badges/security-score removed success response status '200' +in components removed schema 'rules' +removed schema 'network-policies' from components diff --git a/docs/BREAKING-CHANGES-EXAMPLES.md b/docs/BREAKING-CHANGES-EXAMPLES.md index 8862f666..9522a70d 100644 --- a/docs/BREAKING-CHANGES-EXAMPLES.md +++ b/docs/BREAKING-CHANGES-EXAMPLES.md @@ -4,134 +4,136 @@ These examples are automatically generated from unit tests. [Deleting a value from an x-extensible-enum parameter is breaking](../checker/check_request_parameter_x_extensible_enum_value_removed_test.go?plain=1#L11) [Deleting a value from an x-extensible-enum property is breaking](../checker/check_request_property_x_extensible_enum_value_removed_test.go?plain=1#L11) [adding 'allOf' subschema to the request body or request body property is breaking](../checker/check_breaking_test.go?plain=1#L727) -[adding a new required property in request body is breaking](../checker/check_breaking_property_test.go?plain=1#L353) -[adding a pattern to a schema is breaking for recursive properties](../checker/check_breaking_test.go?plain=1#L490) -[adding a pattern to a schema is breaking](../checker/check_breaking_test.go?plain=1#L473) -[adding a required request body is breaking](../checker/check_breaking_test.go?plain=1#L61) -[changing a request body to enum is breaking](../checker/check_breaking_property_test.go?plain=1#L123) -[changing a request body type and changing it to enum simultaneously is breaking](../checker/check_breaking_property_test.go?plain=1#L153) -[changing a request property to not nullable is breaking](../checker/check_breaking_property_test.go?plain=1#L233) -[changing a required property in response body to optional and also deleting it is breaking](../checker/check_breaking_property_test.go?plain=1#L281) -[changing a response body to nullable is breaking](../checker/check_breaking_property_test.go?plain=1#L217) -[changing a response property to nullable is breaking](../checker/check_breaking_property_test.go?plain=1#L249) -[changing a response property to optional under AllOf, AnyOf or OneOf is breaking](../checker/check_breaking_property_test.go?plain=1#L660) -[changing an embedded response property to nullable is breaking](../checker/check_breaking_property_test.go?plain=1#L265) -[changing an existing header param from optional to required is breaking](../checker/check_breaking_test.go?plain=1#L190) -[changing an existing path param to enum is breaking](../checker/check_breaking_property_test.go?plain=1#L185) -[changing an existing property in request body anyOf to required is breaking](../checker/check_breaking_property_test.go?plain=1#L628) -[changing an existing property in request body items to required is breaking](../checker/check_breaking_property_test.go?plain=1#L597) -[changing an existing property in request body to enum is breaking](../checker/check_breaking_property_test.go?plain=1#L169) -[changing an existing property in request body to required is breaking](../checker/check_breaking_property_test.go?plain=1#L337) -[changing an existing property in request header to enum is breaking](../checker/check_breaking_property_test.go?plain=1#L201) -[changing an existing property in request header to required is breaking](../checker/check_breaking_property_test.go?plain=1#L57) -[changing an existing property in response body to optional is breaking](../checker/check_breaking_property_test.go?plain=1#L107) -[changing an existing property under another property in request body to required is breaking](../checker/check_breaking_property_test.go?plain=1#L644) -[changing an existing request body from optional to required is breaking](../checker/check_breaking_test.go?plain=1#L79) -[changing an existing required property in response body to not-write-only is breaking](../checker/check_breaking_property_test.go?plain=1#L561) -[changing an existing response header from required to optional is breaking](../checker/check_breaking_test.go?plain=1#L214) -[changing max length in request from nil to any value is breaking](../checker/check_breaking_min_max_test.go?plain=1#L110) -[changing max length in response from any value to nil is breaking](../checker/check_breaking_min_max_test.go?plain=1#L160) -[changing request's body schema type from number to integer is breaking](../checker/check_breaking_request_type_changed_test.go?plain=1#L52) -[changing request's body schema type from number to string is breaking](../checker/check_breaking_request_type_changed_test.go?plain=1#L32) -[changing request's body schema type from number/none to integer/int32 is breaking](../checker/check_breaking_request_type_changed_test.go?plain=1#L92) -[changing request's body schema type from string to number is breaking](../checker/check_breaking_request_type_changed_test.go?plain=1#L12) -[changing request's query param property type from number to string is breaking](../checker/check_request_parameters_type_changed_test.go?plain=1#L208) -[changing response's body schema type from integer to number is breaking](../checker/check_breaking_response_type_changed_test.go?plain=1#L70) -[changing response's body schema type from number to string is breaking](../checker/check_breaking_response_type_changed_test.go?plain=1#L32) -[changing response's body schema type from string to number is breaking](../checker/check_breaking_response_type_changed_test.go?plain=1#L12) -[changing response's embedded property schema type from string/none to integer/int32 is breaking](../checker/check_breaking_response_type_changed_test.go?plain=1#L109) -[changing sunset from an invalid date for a deprecated endpoint is breaking](../checker/check_api_sunset_changed_test.go?plain=1#L65) -[changing sunset to an earlier date for a deprecated endpoint with a deprecation policy is breaking](../checker/check_api_sunset_changed_test.go?plain=1#L29) -[changing sunset to an invalid date for a deprecated endpoint is breaking](../checker/check_api_sunset_changed_test.go?plain=1#L47) -[decreasing stability level is breaking](../checker/checker_test.go?plain=1#L11) -[deleting a media-type from response is breaking](../checker/check_breaking_test.go?plain=1#L442) -[deleting a non-required non-write-only property in response body is breaking with warning](../checker/check_breaking_property_test.go?plain=1#L512) -[deleting a path is breaking](../checker/check_breaking_test.go?plain=1#L37) -[deleting a path with some operations having sunset date in the future is breaking](../checker/check_api_removed_test.go?plain=1#L86) -[deleting a required property in request is breaking with warn](../checker/check_breaking_property_test.go?plain=1#L369) -[deleting a required property in response body is breaking](../checker/check_breaking_property_test.go?plain=1#L421) -[deleting a required property under AllOf in response body is breaking](../checker/check_breaking_property_test.go?plain=1#L451) -[deleting an embedded optional property in request is breaking with warn](../checker/check_breaking_property_test.go?plain=1#L386) -[deleting an enum value is breaking](../checker/check_breaking_test.go?plain=1#L101) -[deleting an operation before sunset date is breaking](../checker/check_api_removed_test.go?plain=1#L11) -[deleting an operation is breaking](../checker/check_breaking_test.go?plain=1#L45) -[deleting sunset header for a deprecated endpoint is breaking](../checker/check_api_sunset_changed_test.go?plain=1#L11) -[deprecating an operation with a deprecation policy and an invalid stability level is breaking](../checker/check_api_deprecation_test.go?plain=1#L67) -[deprecating an operation with a deprecation policy and an invalid sunset date is breaking](../checker/check_api_deprecation_test.go?plain=1#L48) -[deprecating an operation with a deprecation policy and sunset date before required deprecation period is breaking](../checker/check_api_deprecation_test.go?plain=1#L214) -[deprecating an operation with a deprecation policy but without specifying sunset date is breaking](../checker/check_api_deprecation_test.go?plain=1#L103) +[adding a new required property in request body is breaking: new-required-request-property](../checker/check_breaking_property_test.go?plain=1#L371) +[adding a pattern to a schema is breaking for recursive properties: request-property-pattern-added](../checker/check_breaking_test.go?plain=1#L490) +[adding a pattern to a schema is breaking: request-property-pattern-added](../checker/check_breaking_test.go?plain=1#L473) +[adding a required request body is breaking: request-body-added-required](../checker/check_breaking_test.go?plain=1#L61) +[changing a request body to enum is breaking: request-body-became-enum](../checker/check_breaking_property_test.go?plain=1#L126) +[changing a request body type and changing it to enum simultaneously is breaking: request-body-became-enum, request-body-type-changed](../checker/check_breaking_property_test.go?plain=1#L157) +[changing a request property to not nullable is breaking: request-property-became-not-nullable](../checker/check_breaking_property_test.go?plain=1#L245) +[changing a required property in response body to optional and also deleting it is breaking: response-required-property-removed](../checker/check_breaking_property_test.go?plain=1#L296) +[changing a response body to nullable is breaking: response-body-became-nullable](../checker/check_breaking_property_test.go?plain=1#L228) +[changing a response property to nullable is breaking: response-property-became-nullable](../checker/check_breaking_property_test.go?plain=1#L262) +[changing a response property to optional under AllOf, AnyOf or OneOf is breaking: response-property-became-optional](../checker/check_breaking_property_test.go?plain=1#L703) +[changing an embedded response property to nullable is breaking: response-property-became-nullable](../checker/check_breaking_property_test.go?plain=1#L279) +[changing an existing header param from optional to required is breaking: request-parameter-became-required](../checker/check_breaking_test.go?plain=1#L190) +[changing an existing header param from optional to required is breaking](../checker/check_request_parameter_required_value_updated_test.go?plain=1#L13) +[changing an existing path param to enum is breaking: request-parameter-became-enum](../checker/check_breaking_property_test.go?plain=1#L194) +[changing an existing property in request body anyOf to required is breaking: request-property-became-required](../checker/check_breaking_property_test.go?plain=1#L669) +[changing an existing property in request body items to required is breaking: request-property-became-required](../checker/check_breaking_property_test.go?plain=1#L637) +[changing an existing property in request body to enum is breaking: request-property-became-enum](../checker/check_breaking_property_test.go?plain=1#L177) +[changing an existing property in request body to required is breaking: request-property-became-required](../checker/check_breaking_property_test.go?plain=1#L354) +[changing an existing property in request header to enum is breaking: request-header-property-became-enum](../checker/check_breaking_property_test.go?plain=1#L211) +[changing an existing property in request header to required is breaking: request-header-property-became-required](../checker/check_breaking_property_test.go?plain=1#L58) +[changing an existing property in response body to optional is breaking: response-property-became-optional](../checker/check_breaking_property_test.go?plain=1#L109) +[changing an existing property under another property in request body to required is breaking: request-property-became-required](../checker/check_breaking_property_test.go?plain=1#L686) +[changing an existing request body from optional to required is breaking: request-body-became-required](../checker/check_breaking_test.go?plain=1#L79) +[changing an existing required property in response body to not-write-only is breaking: response-required-property-became-not-write-only](../checker/check_breaking_property_test.go?plain=1#L594) +[changing an existing response header from required to optional is breaking: response-header-became-optional](../checker/check_breaking_test.go?plain=1#L214) +[changing max length in request from nil to any value is breaking: request-parameter-max-length-set](../checker/check_breaking_min_max_test.go?plain=1#L114) +[changing max length in response from any value to nil is breaking: response-body-max-length-unset](../checker/check_breaking_min_max_test.go?plain=1#L165) +[changing request's body schema type from number to integer is breaking: request-body-type-changed](../checker/check_breaking_request_type_changed_test.go?plain=1#L52) +[changing request's body schema type from number to string is breaking: request-body-type-changed](../checker/check_breaking_request_type_changed_test.go?plain=1#L32) +[changing request's body schema type from number/none to integer/int32 is breaking: request-body-type-changed](../checker/check_breaking_request_type_changed_test.go?plain=1#L92) +[changing request's body schema type from string to number is breaking: request-body-type-changed](../checker/check_breaking_request_type_changed_test.go?plain=1#L12) +[changing request's query param property type from number to string is breaking](../checker/check_request_parameters_type_changed_test.go?plain=1#L216) +[changing response's body schema type from integer to number is breaking: response-body-type-changed](../checker/check_breaking_response_type_changed_test.go?plain=1#L70) +[changing response's body schema type from number to string is breaking: response-body-type-changed](../checker/check_breaking_response_type_changed_test.go?plain=1#L32) +[changing response's body schema type from string to number is breaking: response-body-type-changed](../checker/check_breaking_response_type_changed_test.go?plain=1#L12) +[changing response's embedded property schema type from string/none to integer/int32 is breaking: response-property-type-changed](../checker/check_breaking_response_type_changed_test.go?plain=1#L109) +[changing sunset from an invalid date for a deprecated endpoint is breaking: api-path-sunset-parse](../checker/check_api_sunset_changed_test.go?plain=1#L65) +[changing sunset to an earlier date for a deprecated endpoint with a deprecation policy is breaking: api-sunset-date-changed-too-small](../checker/check_api_sunset_changed_test.go?plain=1#L29) +[changing sunset to an invalid date for a deprecated endpoint is breaking: api-path-sunset-parse](../checker/check_api_sunset_changed_test.go?plain=1#L47) +[decreasing stability level is breaking: api-stability-decreased](../checker/checker_test.go?plain=1#L11) +[deleting a media-type from response is breaking: response-media-type-removed](../checker/check_breaking_test.go?plain=1#L442) +[deleting a non-required non-write-only property in response body is breaking with warning: request-property-removed, response-optional-property-removed](../checker/check_breaking_property_test.go?plain=1#L536) +[deleting a path is breaking: api-path-removed-without-deprecation](../checker/check_breaking_test.go?plain=1#L37) +[deleting a path with some operations having sunset date in the future is breaking: api-path-removed-before-sunset](../checker/check_api_removed_test.go?plain=1#L86) +[deleting a required property in request is breaking with warn: request-property-removed](../checker/check_breaking_property_test.go?plain=1#L388) +[deleting a required property in response body is breaking: response-required-property-removed](../checker/check_breaking_property_test.go?plain=1#L442) +[deleting a required property under AllOf in response body is breaking: response-required-property-removed](../checker/check_breaking_property_test.go?plain=1#L473) +[deleting an embedded optional property in request is breaking with warn: request-property-removed](../checker/check_breaking_property_test.go?plain=1#L406) +[deleting an enum value is breaking: request-parameter-enum-value-removed](../checker/check_breaking_test.go?plain=1#L101) +[deleting an operation before sunset date is breaking: api-removed-before-sunset](../checker/check_api_removed_test.go?plain=1#L11) +[deleting an operation is breaking: api-removed-without-deprecation: api-removed-without-deprecation](../checker/check_breaking_test.go?plain=1#L45) +[deleting sunset header for a deprecated endpoint is breaking: sunset-deleted](../checker/check_api_sunset_changed_test.go?plain=1#L11) +[deprecating an operation with a deprecation policy and an invalid stability level is breaking: api-invalid-stability-level](../checker/check_api_deprecation_test.go?plain=1#L67) +[deprecating an operation with a deprecation policy and an invalid sunset date is breaking: api-deprecated-sunset-parse](../checker/check_api_deprecation_test.go?plain=1#L48) +[deprecating an operation with a deprecation policy and sunset date before required deprecation period is breaking: api-sunset-date-too-small](../checker/check_api_deprecation_test.go?plain=1#L214) +[deprecating an operation with a deprecation policy but without specifying sunset date is breaking: api-deprecated-sunset-missing](../checker/check_api_deprecation_test.go?plain=1#L103) [inclreasing request body min items is breaking](../checker/check_request_property_min_items_increased_test.go?plain=1#L12) -[increasing max length in response is breaking](../checker/check_breaking_min_max_test.go?plain=1#L93) -[increasing min items in request is breaking](../checker/check_breaking_min_max_test.go?plain=1#L236) -[modifying a pattern in a schema is breaking](../checker/check_breaking_test.go?plain=1#L507) -[modifying a pattern in request parameter is breaking](../checker/check_breaking_test.go?plain=1#L539) -[modifying the default value of an optional request parameter is breaking](../checker/check_breaking_test.go?plain=1#L570) -[new header, query and cookie required request default param is breaking](../checker/check_new_request_non_path_default_parameter_test.go?plain=1#L12) -[new required header param is breaking](../checker/check_breaking_test.go?plain=1#L173) -[new required path param is breaking](../checker/check_breaking_test.go?plain=1#L156) -[new required property in request header is breaking](../checker/check_breaking_property_test.go?plain=1#L18) -[reducing max in request is breaking](../checker/check_breaking_min_max_test.go?plain=1#L264) -[reducing max length in request is breaking](../checker/check_breaking_min_max_test.go?plain=1#L12) -[reducing min items in response is breaking](../checker/check_breaking_min_max_test.go?plain=1#L220) -[reducing min length in response is breaking](../checker/check_breaking_min_max_test.go?plain=1#L62) +[increasing max length in response is breaking: response-body-max-length-increased](../checker/check_breaking_min_max_test.go?plain=1#L95) +[increasing min items in request is breaking: request-parameter-min-items-increased](../checker/check_breaking_min_max_test.go?plain=1#L243) +[modifying a pattern in a schema is breaking: request-property-pattern-changed](../checker/check_breaking_test.go?plain=1#L507) +[modifying a pattern in request parameter is breaking: request-parameter-pattern-removed](../checker/check_breaking_test.go?plain=1#L539) +[modifying the default value of an optional request parameter is breaking: request-parameter-default-value-changed](../checker/check_breaking_test.go?plain=1#L570) +[new header, query and cookie required request default param is breaking: new-required-request-default-parameter-to-existing-path, new-optional-request-default-parameter-to-existing-path](../checker/check_new_request_non_path_default_parameter_test.go?plain=1#L12) +[new required header param is breaking: new-required-request-parameter](../checker/check_breaking_test.go?plain=1#L173) +[new required path param is breaking: new-request-path-parameter](../checker/check_breaking_test.go?plain=1#L156) +[new required property in request header is breaking: new-required-request-header-property](../checker/check_breaking_property_test.go?plain=1#L18) +[reducing max in request is breaking: request-parameter-max-decreased](../checker/check_breaking_min_max_test.go?plain=1#L273) +[reducing max length in request is breaking: request-parameter-max-length-decreased](../checker/check_breaking_min_max_test.go?plain=1#L12) +[reducing min items in response is breaking: response-body-min-items-decreased](../checker/check_breaking_min_max_test.go?plain=1#L226) +[reducing min length in response is breaking: response-body-min-length-decreased](../checker/check_breaking_min_max_test.go?plain=1#L63) [removing 'allOf' subschema from the request body or request body property is breaking with warn](../checker/check_breaking_test.go?plain=1#L749) [removing 'anyOf' schema from the request body or request body property is breaking](../checker/check_breaking_test.go?plain=1#L684) [removing 'oneOf' schema from the request body or request body property is breaking](../checker/check_breaking_test.go?plain=1#L706) -[removing a deprecated enpoint with an invalid date is breaking](../checker/check_api_removed_test.go?plain=1#L104) +[removing a deprecated enpoint with an invalid date is breaking: api-path-sunset-parse](../checker/check_api_removed_test.go?plain=1#L104) [removing a media type from request body is breaking](../checker/check_breaking_test.go?plain=1#L668) [removing a success status is breaking](../checker/check_response_status_updated_test.go?plain=1#L87) -[removing an existing optional response header is breaking as warn](../checker/check_breaking_test.go?plain=1#L422) -[removing an existing required response header is breaking as error](../checker/check_breaking_test.go?plain=1#L231) -[removing an existing response with non-successful status is breaking (optional)](../checker/check_breaking_test.go?plain=1#L270) -[removing an existing response with successful status is breaking](../checker/check_breaking_test.go?plain=1#L251) -[removing an schema object from components is breaking (optional)](../checker/check_breaking_test.go?plain=1#L643) -[removing the default value of an optional request parameter is breaking](../checker/check_breaking_test.go?plain=1#L606) -[removing the path without a deprecation policy and without specifying sunset date is breaking if some APIs are not alpha stability level](../checker/check_api_removed_test.go?plain=1#L44) -[removing the path without a deprecation policy and without specifying sunset date is breaking if some APIs are not draft stability level](../checker/check_api_removed_test.go?plain=1#L64) -[removing/updating a property enum in response is breaking (optional)](../checker/check_breaking_test.go?plain=1#L333) -[removing/updating a tag is breaking (optional)](../checker/check_breaking_test.go?plain=1#L351) -[removing/updating an enum in request body is breaking (optional)](../checker/check_breaking_test.go?plain=1#L310) -[removing/updating an operation id is breaking (optional)](../checker/check_breaking_test.go?plain=1#L289) -[setting the default value of an optional request parameter is breaking](../checker/check_breaking_test.go?plain=1#L588) -[specializing request's query param property type from string to number is breaking](../checker/check_request_parameters_type_changed_test.go?plain=1#L225) +[removing an existing optional response header is breaking as warn: optional-response-header-removed](../checker/check_breaking_test.go?plain=1#L422) +[removing an existing required response header is breaking as error: required-response-header-removed](../checker/check_breaking_test.go?plain=1#L231) +[removing an existing response with non-successful status is breaking (optional): response-non-success-status-removed](../checker/check_breaking_test.go?plain=1#L270) +[removing an existing response with successful status is breaking: response-success-status-removed](../checker/check_breaking_test.go?plain=1#L251) +[removing an schema object from components is breaking (optional): api-schema-removed](../checker/check_breaking_test.go?plain=1#L643) +[removing the default value of an optional request parameter is breaking: request-parameter-default-value-removed](../checker/check_breaking_test.go?plain=1#L606) +[removing the path without a deprecation policy and without specifying sunset date is breaking if some APIs are not alpha stability level: api-path-removed-without-deprecation](../checker/check_api_removed_test.go?plain=1#L44) +[removing the path without a deprecation policy and without specifying sunset date is breaking if some APIs are not draft stability level: api-path-removed-without-deprecation](../checker/check_api_removed_test.go?plain=1#L64) +[removing/updating a property enum in response is breaking (optional): response-property-enum-value-removed](../checker/check_breaking_test.go?plain=1#L333) +[removing/updating a tag is breaking (optional): api-tag-removed](../checker/check_breaking_test.go?plain=1#L351) +[removing/updating an enum in request body is breaking (optional): request-body-enum-value-removed](../checker/check_breaking_test.go?plain=1#L310) +[removing/updating an operation id is breaking (optional): api-operation-id-removed](../checker/check_breaking_test.go?plain=1#L289) +[setting the default value of an optional request parameter is breaking: request-parameter-default-value-added](../checker/check_breaking_test.go?plain=1#L588) +[specializing request's query param property type from string to number is breaking](../checker/check_request_parameters_type_changed_test.go?plain=1#L233) [specifying a non-text, not-json stability level in base is breaking](../checker/checker_test.go?plain=1#L82) [specifying an invalid stability level in base is breaking](../checker/checker_test.go?plain=1#L65) [specifying an invalid stability level in revision is breaking](../checker/checker_test.go?plain=1#L48) +[specifying an invalid stability level is breaking: api-invalid-stability-level](../checker/check_api_deprecation_test.go?plain=1#L317) ## Examples of non-breaking changes [adding a media-type to response is not breaking](../checker/check_not_breaking_test.go?plain=1#L184) -[adding a new required property in response body is not breaking](../checker/check_breaking_property_test.go?plain=1#L407) -[adding a new required property under AllOf in response body is not breaking](../checker/check_breaking_property_test.go?plain=1#L437) -[adding a new required read-only property in request body is not breaking](../checker/check_breaking_property_test.go?plain=1#L467) -[adding a non-existent required property in request body is not breaking](../checker/check_breaking_property_test.go?plain=1#L295) +[adding a new required property in response body is not breaking](../checker/check_breaking_property_test.go?plain=1#L428) +[adding a new required property under AllOf in response body is not breaking](../checker/check_breaking_property_test.go?plain=1#L459) +[adding a new required read-only property in request body is not breaking](../checker/check_breaking_property_test.go?plain=1#L490) +[adding a non-existent required property in request body is not breaking](../checker/check_breaking_property_test.go?plain=1#L312) [adding a required property to response is not breaking](../checker/check_not_breaking_test.go?plain=1#L289) [adding a tag is not breaking](../checker/check_not_breaking_test.go?plain=1#L266) [adding an enum value is not breaking](../checker/check_not_breaking_test.go?plain=1#L82) -[adding an enum value to request body is not breaking](../checker/check_breaking_property_test.go?plain=1#L139) +[adding an enum value to request body is not breaking](../checker/check_breaking_property_test.go?plain=1#L143) [adding an operation ID is not breaking](../checker/check_not_breaking_test.go?plain=1#L277) [adding an optional request body is not breaking](../checker/check_not_breaking_test.go?plain=1#L38) -[both max lengths in request are nil is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L178) -[both max lengths in response are nil is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L192) +[both max lengths in request are nil is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L184) +[both max lengths in response are nil is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L198) [changing a link to operation ID is not breaking](../checker/check_not_breaking_test.go?plain=1#L175) -[changing an existing property in request body items to required with a default value is not breaking](../checker/check_breaking_property_test.go?plain=1#L614) -[changing an existing property in request body to optional is not breaking](../checker/check_breaking_property_test.go?plain=1#L323) -[changing an existing property in request header to optional is not breaking](../checker/check_breaking_property_test.go?plain=1#L83) -[changing an existing property in response body to required is not breaking](../checker/check_breaking_property_test.go?plain=1#L309) -[changing an existing read-only property in request body to required is not breaking](../checker/check_breaking_property_test.go?plain=1#L481) -[changing an existing required property in response body to write-only is not breaking](../checker/check_breaking_property_test.go?plain=1#L547) -[changing an existing write-only property in response body to optional is not breaking](../checker/check_breaking_property_test.go?plain=1#L533) +[changing an existing property in request body items to required with a default value is not breaking](../checker/check_breaking_property_test.go?plain=1#L655) +[changing an existing property in request body to optional is not breaking](../checker/check_breaking_property_test.go?plain=1#L340) +[changing an existing property in request header to optional is not breaking](../checker/check_breaking_property_test.go?plain=1#L85) +[changing an existing property in response body to required is not breaking](../checker/check_breaking_property_test.go?plain=1#L326) +[changing an existing read-only property in request body to required is not breaking](../checker/check_breaking_property_test.go?plain=1#L504) +[changing an existing required property in response body to write-only is not breaking](../checker/check_breaking_property_test.go?plain=1#L580) +[changing an existing write-only property in response body to optional is not breaking](../checker/check_breaking_property_test.go?plain=1#L566) [changing comments is not breaking](../checker/check_not_breaking_test.go?plain=1#L106) [changing extensions is not breaking](../checker/check_not_breaking_test.go?plain=1#L94) -[changing max length in request from any value to nil is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L144) -[changing max length in response from nil to any value is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L128) +[changing max length in request from any value to nil is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L149) +[changing max length in response from nil to any value is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L133) [changing operation ID is not breaking](../checker/check_not_breaking_test.go?plain=1#L166) -[changing request's body schema type from integer to number is not breaking](../checker/check_breaking_request_type_changed_test.go?plain=1#L72) +[changing request's body schema type from integer to number is not breaking: request-body-type-generalized](../checker/check_breaking_request_type_changed_test.go?plain=1#L72) [changing response's body schema type from number to integer is not breaking](../checker/check_breaking_response_type_changed_test.go?plain=1#L52) [changing response's body schema type from number/none to integer/int32 is not breaking](../checker/check_breaking_response_type_changed_test.go?plain=1#L90) [changing servers is not breaking](../checker/check_not_breaking_test.go?plain=1#L252) -[deleting a path after sunset date of all contained operations is not breaking](../checker/check_api_deprecation_test.go?plain=1#L255) +[deleting a path after sunset date of all contained operations is not breaking](../checker/check_api_deprecation_test.go?plain=1#L256) [deleting a pattern from a schema is not breaking](../checker/check_breaking_test.go?plain=1#L459) -[deleting a required write-only property in response body is not breaking](../checker/check_breaking_property_test.go?plain=1#L495) +[deleting a required write-only property in response body is not breaking: request-property-removed](../checker/check_breaking_property_test.go?plain=1#L518) [deleting a tag is not breaking](../checker/check_not_breaking_test.go?plain=1#L71) [deleting an operation after sunset date is not breaking](../checker/check_api_deprecation_test.go?plain=1#L33) [deleting an operation without sunset date is not breaking](../checker/check_api_removed_test.go?plain=1#L29) @@ -140,26 +142,26 @@ These examples are automatically generated from unit tests. [deprecating a parameter is not breaking](../checker/check_not_breaking_test.go?plain=1#L213) [deprecating a schema is not breaking](../checker/check_not_breaking_test.go?plain=1#L239) [deprecating an operation with a default deprecation policy but without specifying sunset date is not breaking](../checker/check_api_deprecation_test.go?plain=1#L121) -[deprecating an operation with a deprecation policy and sunset date after required deprecation period is not breaking](../checker/check_api_deprecation_test.go?plain=1#L234) +[deprecating an operation with a deprecation policy and sunset date after required deprecation period is not breaking: endpoint-deprecated](../checker/check_api_deprecation_test.go?plain=1#L234) [deprecating an operation without a deprecation policy and without specifying sunset date is not breaking for alpha level](../checker/check_api_deprecation_test.go?plain=1#L137) [deprecating an operation without a deprecation policy and without specifying sunset date is not breaking for draft level](../checker/check_api_deprecation_test.go?plain=1#L171) [deprecating an operation without a deprecation policy but without specifying sunset date is not breaking](../checker/check_api_deprecation_test.go?plain=1#L87) [descreasing request body min items is not breaking](../checker/check_request_property_min_items_increased_test.go?plain=1#L35) -[increasing max length in request is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L76) -[increasing min items in response is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L250) +[increasing max length in request is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L78) +[increasing min items in response is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L259) [increasing stability level is not breaking](../checker/checker_test.go?plain=1#L33) [modifying a pattern to ".*" in a schema is not breaking](../checker/check_breaking_test.go?plain=1#L556) [modifying a pattern to .* in a schema is not breaking](../checker/check_breaking_test.go?plain=1#L525) [modifying the default value of a required request parameter is not breaking](../checker/check_breaking_test.go?plain=1#L624) [new optional header param is not breaking](../checker/check_not_breaking_test.go?plain=1#L118) -[new optional property in request header is not breaking](../checker/check_breaking_property_test.go?plain=1#L39) +[new optional property in request header is not breaking](../checker/check_breaking_property_test.go?plain=1#L40) [new required response header param is not breaking](../checker/check_not_breaking_test.go?plain=1#L152) [no change is not breaking](../checker/check_not_breaking_test.go?plain=1#L27) [no change to headers for a deprecated endpoint is not breaking](../checker/check_api_sunset_changed_test.go?plain=1#L99) -[reducing max in response is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L281) -[reducing max length in response is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L31) -[reducing min items in request is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L206) -[reducing min length in request is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L48) +[reducing max in response is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L292) +[reducing max length in response is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L32) +[reducing min items in request is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L212) +[reducing min length in request is not breaking](../checker/check_breaking_min_max_test.go?plain=1#L49) [removing an existing response with error status is not breaking](../checker/check_breaking_test.go?plain=1#L406) [removing an existing response with unparseable status is not breaking](../checker/check_breaking_test.go?plain=1#L390) [removing the path without a deprecation policy and without specifying sunset date is not breaking for alpha level](../checker/check_api_deprecation_test.go?plain=1#L152) @@ -173,22 +175,22 @@ These examples are automatically generated from unit tests. [adding 'anyOf' schema to the response body or response body property](../checker/check_response_property_any_of_updated_test.go?plain=1#L12) [adding 'oneOf' schema to the request body or request body property](../checker/check_request_property_one_of_updated_test.go?plain=1#L12) [adding 'oneOf' schema to the response body or response body property](../checker/check_response_property_one_of_updated_test.go?plain=1#L12) -[adding a new global security to the API](../checker/check_api_security_updated_test.go?plain=1#L12) +[adding a new global security to the API: api-global-security-added](../checker/check_api_security_updated_test.go?plain=1#L12) [adding a new media type to request body](../checker/check_request_body_mediatype_updated_test.go?plain=1#L12) [adding a new media type to response](../checker/check_response_mediatype_updated_test.go?plain=1#L12) -[adding a new oauth security scope](../checker/check_components_security_updated_test.go?plain=1#L117) -[adding a new operation id](../checker/check_api_operation_id_updated_test.go?plain=1#L62) -[adding a new optional request property](../checker/check_request_property_updated_test.go?plain=1#L65) -[adding a new required request property with a default value](../checker/check_request_property_updated_test.go?plain=1#L110) +[adding a new oauth security scope: api-security-component-oauth-scope-added](../checker/check_components_security_updated_test.go?plain=1#L117) +[adding a new operation id: api-operation-id-added](../checker/check_api_operation_id_updated_test.go?plain=1#L64) +[adding a new optional request property](../checker/check_request_property_updated_test.go?plain=1#L70) +[adding a new required request property with a default value: new-required-request-property-with-default](../checker/check_request_property_updated_test.go?plain=1#L117) [adding a new required request property](../checker/check_request_property_updated_test.go?plain=1#L12) -[adding a new security component](../checker/check_components_security_updated_test.go?plain=1#L77) -[adding a new security to the API endpoint](../checker/check_api_security_updated_test.go?plain=1#L90) -[adding a new tag](../checker/check_api_tag_updated_test.go?plain=1#L12) +[adding a new security component: api-security-component-added](../checker/check_components_security_updated_test.go?plain=1#L77) +[adding a new security to the API endpoint: api-security-added](../checker/check_api_security_updated_test.go?plain=1#L90) +[adding a new tag: api-tag-added](../checker/check_api_tag_updated_test.go?plain=1#L12) [adding a non-success response status](../checker/check_response_status_updated_test.go?plain=1#L37) [adding a required property to response body is detected](../checker/check_response_required_property_updated_test.go?plain=1#L12) [adding a required write-only property to response body is detected](../checker/check_response_required_property_updated_test.go?plain=1#L58) -[adding a security scope from an API global security](../checker/check_api_security_updated_test.go?plain=1#L70) -[adding a security scope to an API endpoint security](../checker/check_api_security_updated_test.go?plain=1#L156) +[adding a security scope from an API global security: api-global-security-scope-added](../checker/check_api_security_updated_test.go?plain=1#L70) +[adding a security scope to an API endpoint security: api-security-scope-added](../checker/check_api_security_updated_test.go?plain=1#L156) [adding a success response status](../checker/check_response_status_updated_test.go?plain=1#L12) [adding an enum value to a response property](../checker/check_response_property_enum_value_added_test.go?plain=1#L12) [adding an enum value to a response write-only property](../checker/check_response_property_enum_value_added_test.go?plain=1#L38) @@ -196,19 +198,19 @@ These examples are automatically generated from unit tests. [adding an optional write-only property to a response](../checker/check_response_optional_property_updated_test.go?plain=1#L34) [adding discriminator to the request body or request body property](../checker/check_request_discriminator_updated_test.go?plain=1#L13) [adding discriminator to the response body or response property](../checker/check_response_discriminator_updated_test.go?plain=1#L13) -[adding pattern to request parameters](../checker/check_request_parameter_pattern_added_or_changed_test.go?plain=1#L60) +[adding pattern to request parameters: request-parameter-pattern-added](../checker/check_request_parameter_pattern_added_or_changed_test.go?plain=1#L60) [adding request body default value or request property default value](../checker/check_request_property_default_value_changed_test.go?plain=1#L58) [adding request parameter default value](../checker/check_request_parameters_default_value_changed_test.go?plain=1#L34) [adding request property enum values](../checker/check_request_property_enum_value_updated_test.go?plain=1#L67) -[adding request property pattern](../checker/check_request_property_pattern_added_or_changed_test.go?plain=1#L60) -[adding response body default value or response body property default value](../checker/check_response_property_default_value_changed_test.go?plain=1#L64) +[adding request property pattern: request-property-pattern-added](../checker/check_request_property_pattern_added_or_changed_test.go?plain=1#L62) +[adding response body default value or response body property default value](../checker/check_response_property_default_value_changed_test.go?plain=1#L70) [adding response property pattern](../checker/check_response_pattern_added_or_changed_test.go?plain=1#L37) -[adding two new request properties, one required, one optional](../checker/check_request_property_updated_test.go?plain=1#L34) +[adding two new request properties, one required, one optional: new-required-request-property, new-optional-request-property](../checker/check_request_property_updated_test.go?plain=1#L35) [changing a response property schema format](../checker/check_response_property_type_changed_test.go?plain=1#L60) [changing a response property schema type from a single value to to multiple types](../checker/check_response_property_type_changed_test.go?plain=1#L126) [changing a response property schema type from string to integer](../checker/check_response_property_type_changed_test.go?plain=1#L36) [changing a response schema type](../checker/check_response_property_type_changed_test.go?plain=1#L14) -[changing an existing header param from required to optional](../checker/check_request_parameter_required_value_updated_test.go?plain=1#L35) +[changing an existing header param from required to optional](../checker/check_request_parameter_required_value_updated_test.go?plain=1#L36) [changing an existing header param to optional](../checker/check_not_breaking_test.go?plain=1#L132) [changing an existing request body from required to optional](../checker/check_not_breaking_test.go?plain=1#L53) [changing discriminator mapping in the request body or request body property](../checker/check_request_discriminator_updated_test.go?plain=1#L113) @@ -225,58 +227,58 @@ These examples are automatically generated from unit tests. [changing optional response property to required](../checker/check_response_property_became_required_test.go?plain=1#L12) [changing optional response property to write-only](../checker/check_response_optional_property_write_only_read_only_test.go?plain=1#L12) [changing optional response write-only property to required](../checker/check_response_property_became_required_test.go?plain=1#L33) -[changing pattern of request parameters](../checker/check_request_parameter_pattern_added_or_changed_test.go?plain=1#L12) +[changing pattern of request parameters: request-parameter-pattern-changed](../checker/check_request_parameter_pattern_added_or_changed_test.go?plain=1#L12) [changing properties of subschemas under allOf](../checker/check_response_property_type_changed_test.go?plain=1#L84) -[changing request body and property types from array to object](../checker/check_request_property_type_changed_test.go?plain=1#L87) -[changing request body and property types from object to array](../checker/check_request_property_type_changed_test.go?plain=1#L119) +[changing request body and property types from array to object](../checker/check_request_property_type_changed_test.go?plain=1#L90) +[changing request body and property types from object to array](../checker/check_request_property_type_changed_test.go?plain=1#L125) [changing request body default value](../checker/check_request_property_default_value_changed_test.go?plain=1#L12) [changing request body to not nullable](../checker/check_request_property_became_not_nuallable_test.go?plain=1#L81) [changing request body to nullable](../checker/check_request_property_became_not_nuallable_test.go?plain=1#L57) [changing request body type](../checker/check_request_property_type_changed_test.go?plain=1#L14) -[changing request header parameter format](../checker/check_request_parameters_type_changed_test.go?plain=1#L134) -[changing request header parameter type](../checker/check_request_parameters_type_changed_test.go?plain=1#L62) +[changing request header parameter format](../checker/check_request_parameters_type_changed_test.go?plain=1#L139) +[changing request header parameter type](../checker/check_request_parameters_type_changed_test.go?plain=1#L64) [changing request parameter default value](../checker/check_request_parameters_default_value_changed_test.go?plain=1#L12) [changing request parameter type to enum](../checker/check_request_parameter_became_enum_test.go?plain=1#L12) -[changing request path parameter format](../checker/check_request_parameters_type_changed_test.go?plain=1#L86) -[changing request path parameter type by adding "string"](../checker/check_request_parameters_type_changed_test.go?plain=1#L158) -[changing request path parameter type by replacing "integer" with "number"](../checker/check_request_parameters_type_changed_test.go?plain=1#L183) +[changing request path parameter format](../checker/check_request_parameters_type_changed_test.go?plain=1#L89) +[changing request path parameter type by adding "string"](../checker/check_request_parameters_type_changed_test.go?plain=1#L164) +[changing request path parameter type by replacing "integer" with "number"](../checker/check_request_parameters_type_changed_test.go?plain=1#L190) [changing request path parameter type](../checker/check_request_parameters_type_changed_test.go?plain=1#L14) [changing request property default value](../checker/check_request_property_default_value_changed_test.go?plain=1#L34) -[changing request property format](../checker/check_request_property_type_changed_test.go?plain=1#L151) -[changing request property pattern](../checker/check_request_property_pattern_added_or_changed_test.go?plain=1#L12) -[changing request property required value to false](../checker/check_request_property_required_updated_test.go?plain=1#L35) +[changing request property format](../checker/check_request_property_type_changed_test.go?plain=1#L160) +[changing request property pattern: request-property-pattern-changed](../checker/check_request_property_pattern_added_or_changed_test.go?plain=1#L12) +[changing request property required value to false](../checker/check_request_property_required_updated_test.go?plain=1#L36) [changing request property required value to true](../checker/check_request_property_required_updated_test.go?plain=1#L12) [changing request property to not nullable](../checker/check_request_property_became_not_nuallable_test.go?plain=1#L12) [changing request property to nullable](../checker/check_request_property_became_not_nuallable_test.go?plain=1#L34) -[changing request property type](../checker/check_request_property_type_changed_test.go?plain=1#L64) -[changing request query parameter format](../checker/check_request_parameters_type_changed_test.go?plain=1#L110) -[changing request query parameter type](../checker/check_request_parameters_type_changed_test.go?plain=1#L38) +[changing request property type](../checker/check_request_property_type_changed_test.go?plain=1#L66) +[changing request query parameter format](../checker/check_request_parameters_type_changed_test.go?plain=1#L114) +[changing request query parameter type](../checker/check_request_parameters_type_changed_test.go?plain=1#L39) [changing request's body to optional](../checker/check_request_body_required_value_updated_test.go?plain=1#L35) [changing request's body to required is breaking](../checker/check_request_body_required_value_updated_test.go?plain=1#L12) [changing required request property to not read-only](../checker/check_request_property_write_only_read_only_test.go?plain=1#L187) [changing required request property to not write-only](../checker/check_request_property_write_only_read_only_test.go?plain=1#L137) [changing required request property to read-only](../checker/check_request_property_write_only_read_only_test.go?plain=1#L162) [changing required request property to write-only](../checker/check_request_property_write_only_read_only_test.go?plain=1#L112) -[changing required response property to not read-only](../checker/check_response_required_property_write_only_read_only_test.go?plain=1#L90) +[changing required response property to not read-only](../checker/check_response_required_property_write_only_read_only_test.go?plain=1#L91) [changing required response property to not write-only](../checker/check_response_required_property_write_only_read_only_test.go?plain=1#L37) [changing required response property to optional](../checker/check_response_property_became_optional_test.go?plain=1#L12) [changing required response property to read-only](../checker/check_response_required_property_write_only_read_only_test.go?plain=1#L65) [changing required response property to write-only](../checker/check_response_required_property_write_only_read_only_test.go?plain=1#L12) -[changing response body default value](../checker/check_response_property_default_value_changed_test.go?plain=1#L41) +[changing response body default value](../checker/check_response_property_default_value_changed_test.go?plain=1#L46) [changing response body property default value](../checker/check_response_property_default_value_changed_test.go?plain=1#L12) [changing response property pattern](../checker/check_response_pattern_added_or_changed_test.go?plain=1#L12) -[changing security component oauth's url](../checker/check_components_security_updated_test.go?plain=1#L11) -[changing security component token url](../checker/check_components_security_updated_test.go?plain=1#L33) -[changing security component type](../checker/check_components_security_updated_test.go?plain=1#L55) +[changing security component oauth's url: api-security-component-oauth-url-changed](../checker/check_components_security_updated_test.go?plain=1#L11) +[changing security component token url: api-security-component-oauth-token-url-changed](../checker/check_components_security_updated_test.go?plain=1#L33) +[changing security component type: api-security-component-type-changed](../checker/check_components_security_updated_test.go?plain=1#L55) [changing write-only required response property to optional](../checker/check_response_property_became_optional_test.go?plain=1#L33) -[decreasing max length of request body](../checker/check_request_property_max_length_updated_test.go?plain=1#L40) -[decreasing max length of request property](../checker/check_request_property_max_length_updated_test.go?plain=1#L68) -[decreasing max length of request read-only property](../checker/check_request_property_max_length_updated_test.go?plain=1#L96) +[decreasing max length of request body](../checker/check_request_property_max_length_updated_test.go?plain=1#L41) +[decreasing max length of request property](../checker/check_request_property_max_length_updated_test.go?plain=1#L70) +[decreasing max length of request read-only property](../checker/check_request_property_max_length_updated_test.go?plain=1#L98) [decreasing maxItems of request parameters](../checker/check_request_parameters_max_items_updated_test.go?plain=1#L34) [decreasing maxLength of request parameters](../checker/check_request_parameters_max_length_updated_test.go?plain=1#L33) [decreasing maximum value of request parameter](../checker/check_request_parameters_max_updated_test.go?plain=1#L34) [decreasing minItems value of request parameter](../checker/check_request_parameters_min_items_updated_test.go?plain=1#L34) -[decreasing minLength of request body](../checker/check_request_property_min_length_updated_test.go?plain=1#L84) +[decreasing minLength of request body](../checker/check_request_property_min_length_updated_test.go?plain=1#L87) [decreasing minLength of request property](../checker/check_request_property_min_length_updated_test.go?plain=1#L12) [decreasing minLength value of request parameter](../checker/check_request_parameters_min_length_updated_test.go?plain=1#L35) [decreasing minimum value of request parameter](../checker/check_request_parameters_min_updated_test.go?plain=1#L34) @@ -285,67 +287,68 @@ These examples are automatically generated from unit tests. [decreasing request property maximum value](../checker/check_request_property_max_updated_test.go?plain=1#L12) [decreasing request read-only property maximum value](../checker/check_request_property_max_updated_test.go?plain=1#L38) [deprecating an operation with sunset greater than min](../checker/check_not_breaking_test.go?plain=1#L198) -[generalizing pattern of request parameters](../checker/check_request_parameter_pattern_added_or_changed_test.go?plain=1#L37) -[generalizing request property format](../checker/check_request_property_type_changed_test.go?plain=1#L176) -[generalizing request property pattern](../checker/check_request_property_pattern_added_or_changed_test.go?plain=1#L37) -[generalizing request's query param property type from integer to number](../checker/check_request_parameters_type_changed_test.go?plain=1#L242) +[generalizing pattern of request parameters: request-parameter-pattern-generalized](../checker/check_request_parameter_pattern_added_or_changed_test.go?plain=1#L37) +[generalizing request property format](../checker/check_request_property_type_changed_test.go?plain=1#L186) +[generalizing request property pattern: request-property-pattern-generalized](../checker/check_request_property_pattern_added_or_changed_test.go?plain=1#L38) +[generalizing request's query param property type from integer to number](../checker/check_request_parameters_type_changed_test.go?plain=1#L250) [increasing max length of request body](../checker/check_request_property_max_length_updated_test.go?plain=1#L12) -[increasing max length of request property](../checker/check_request_property_max_length_updated_test.go?plain=1#L126) +[increasing max length of request property](../checker/check_request_property_max_length_updated_test.go?plain=1#L128) [increasing maxItems of request parameters](../checker/check_request_parameters_max_items_updated_test.go?plain=1#L12) [increasing maxLength of request parameters](../checker/check_request_parameters_max_length_updated_test.go?plain=1#L12) [increasing maximum value of request parameter](../checker/check_request_parameters_max_updated_test.go?plain=1#L12) [increasing minItems value of request parameter](../checker/check_request_parameters_min_items_updated_test.go?plain=1#L12) -[increasing minLength of request body](../checker/check_request_property_min_length_updated_test.go?plain=1#L60) -[increasing minLength of request property](../checker/check_request_property_min_length_updated_test.go?plain=1#L36) +[increasing minLength of request body](../checker/check_request_property_min_length_updated_test.go?plain=1#L62) +[increasing minLength of request property](../checker/check_request_property_min_length_updated_test.go?plain=1#L37) [increasing minLength value of request parameter](../checker/check_request_parameters_min_length_updated_test.go?plain=1#L12) [increasing minimum value of request parameter](../checker/check_request_parameters_min_updated_test.go?plain=1#L12) [increasing minimum value of request property](../checker/check_request_property_min_updated_test.go?plain=1#L12) [increasing minimum value of request read-only property](../checker/check_request_property_min_updated_test.go?plain=1#L35) [increasing request body maximum value](../checker/check_request_property_max_updated_test.go?plain=1#L91) [increasing request property maximum value](../checker/check_request_property_max_updated_test.go?plain=1#L65) -[making request property required, while also giving it a default value](../checker/check_request_property_required_updated_test.go?plain=1#L58) -[new header, query and cookie request params](../checker/check_new_request_non_path_parameter_test.go?plain=1#L11) -[new paths or path operations](../checker/check_api_added_test.go?plain=1#L11) -[path operations that became deprecated](../checker/check_api_deprecation_test.go?plain=1#L270) -[path operations that were re-activated](../checker/check_api_deprecation_test.go?plain=1#L293) -[removing 'allOf' subschema from the request body or request body property](../checker/check_request_property_all_of_updated_test.go?plain=1#L46) +[making request property required, while also giving it a default value](../checker/check_request_property_required_updated_test.go?plain=1#L60) +[new header, query and cookie request params: new-optional-request-parameter](../checker/check_new_request_non_path_parameter_test.go?plain=1#L11) +[new paths or path operations: endpoint-added](../checker/check_api_added_test.go?plain=1#L11) +[path operations that became deprecated: endpoint-deprecated](../checker/check_api_deprecation_test.go?plain=1#L271) +[path operations that were re-activated: endpoint-reactivated](../checker/check_api_deprecation_test.go?plain=1#L294) +[removing 'allOf' subschema from the request body or request body property](../checker/check_request_property_all_of_updated_test.go?plain=1#L48) [removing 'allOf' subschema from the response body or response body property](../checker/check_response_property_all_of_updated_test.go?plain=1#L46) -[removing 'anyOf' schema from the request body or request body property](../checker/check_request_property_any_of_updated_test.go?plain=1#L46) +[removing 'anyOf' schema from the request body or request body property](../checker/check_request_property_any_of_updated_test.go?plain=1#L48) [removing 'anyOf' schema from the response body or response body property](../checker/check_response_property_any_of_updated_test.go?plain=1#L46) -[removing 'oneOf' schema from the request body or request body property](../checker/check_request_property_one_of_updated_test.go?plain=1#L46) +[removing 'oneOf' schema from the request body or request body property](../checker/check_request_property_one_of_updated_test.go?plain=1#L48) [removing 'oneOf' schema from the response body or response body property](../checker/check_response_property_one_of_updated_test.go?plain=1#L55) -[removing a global security from the API](../checker/check_api_security_updated_test.go?plain=1#L31) +[removing a global security from the API: api-global-security-removed](../checker/check_api_security_updated_test.go?plain=1#L31) [removing a new media type to response](../checker/check_response_mediatype_updated_test.go?plain=1#L34) -[removing a new oauth security scope](../checker/check_components_security_updated_test.go?plain=1#L139) -[removing a new security component](../checker/check_components_security_updated_test.go?plain=1#L97) -[removing a new security to the API endpoint](../checker/check_api_security_updated_test.go?plain=1#L112) +[removing a new oauth security scope: api-security-component-oauth-scope-changed](../checker/check_components_security_updated_test.go?plain=1#L162) +[removing a new oauth security scope: api-security-component-oauth-scope-removed](../checker/check_components_security_updated_test.go?plain=1#L139) +[removing a new security component: api-security-component-removed](../checker/check_components_security_updated_test.go?plain=1#L97) +[removing a new security to the API endpoint: api-security-removed](../checker/check_api_security_updated_test.go?plain=1#L112) [removing a non-success response status](../checker/check_response_status_updated_test.go?plain=1#L62) -[removing a required request property](../checker/check_request_property_updated_test.go?plain=1#L88) +[removing a required request property](../checker/check_request_property_updated_test.go?plain=1#L94) [removing a required write-only property that was required in response body is detected](../checker/check_response_required_property_updated_test.go?plain=1#L83) -[removing a security scope from an API endpoint security](../checker/check_api_security_updated_test.go?plain=1#L134) -[removing a security scope from an API global security](../checker/check_api_security_updated_test.go?plain=1#L50) +[removing a security scope from an API endpoint security: api-security-scope-removed](../checker/check_api_security_updated_test.go?plain=1#L134) +[removing a security scope from an API global security: api-global-security-scope-removed](../checker/check_api_security_updated_test.go?plain=1#L50) [removing an enum value from a response property](../checker/check_response_property_enum_value_removed_test.go?plain=1#L12) [removing an enum value from a response write-only property](../checker/check_response_property_enum_value_removed_test.go?plain=1#L36) [removing an enum value from request parameter](../checker/check_request_parameter_enum_value_updated_test.go?plain=1#L12) [removing an existent property that was required in response body is detected](../checker/check_response_required_property_updated_test.go?plain=1#L35) -[removing an existing operation id](../checker/check_api_operation_id_updated_test.go?plain=1#L12) -[removing an existing tag](../checker/check_api_tag_updated_test.go?plain=1#L37) +[removing an existing operation id: api-operation-id-removed](../checker/check_api_operation_id_updated_test.go?plain=1#L12) +[removing an existing tag: api-tag-removed](../checker/check_api_tag_updated_test.go?plain=1#L37) [removing an optional write-only property from a response](../checker/check_response_optional_property_updated_test.go?plain=1#L12) [removing discriminator from the request body or request body property](../checker/check_request_discriminator_updated_test.go?plain=1#L46) [removing discriminator from the response body or response property](../checker/check_response_discriminator_updated_test.go?plain=1#L47) [removing media type from request body](../checker/check_request_body_mediatype_updated_test.go?plain=1#L34) -[removing pattern from request parameters](../checker/check_request_parameter_pattern_added_or_changed_test.go?plain=1#L83) +[removing pattern from request parameters: request-parameter-pattern-removed](../checker/check_request_parameter_pattern_added_or_changed_test.go?plain=1#L84) [removing request body default value or request property default value](../checker/check_request_property_default_value_changed_test.go?plain=1#L91) [removing request parameter default value](../checker/check_request_parameters_default_value_changed_test.go?plain=1#L58) [removing request property enum values](../checker/check_request_property_enum_value_updated_test.go?plain=1#L12) -[removing request property pattern](../checker/check_request_property_pattern_added_or_changed_test.go?plain=1#L83) +[removing request property pattern: request-property-pattern-removed](../checker/check_request_property_pattern_added_or_changed_test.go?plain=1#L86) [removing request read-only property enum values](../checker/check_request_property_enum_value_updated_test.go?plain=1#L39) -[removing response body default value or response body property default value](../checker/check_response_property_default_value_changed_test.go?plain=1#L97) +[removing response body default value or response body property default value](../checker/check_response_property_default_value_changed_test.go?plain=1#L108) [removing response property pattern](../checker/check_response_pattern_added_or_changed_test.go?plain=1#L62) [setting max of request body](../checker/check_request_property_max_set_test.go?plain=1#L12) [setting max of request propreties](../checker/check_request_property_max_set_test.go?plain=1#L35) [setting maxLength of request body](../checker/check_request_property_max_length_set_test.go?plain=1#L12) [setting maxLength of request parameters](../checker/check_request_parameters_max_length_set_test.go?plain=1#L12) [setting maxLength of request propreties](../checker/check_request_property_max_length_set_test.go?plain=1#L35) -[updating an existing operation id](../checker/check_api_operation_id_updated_test.go?plain=1#L36) -[updating an existing tag](../checker/check_api_tag_updated_test.go?plain=1#L64) +[updating an existing operation id: api-operation-id-removed](../checker/check_api_operation_id_updated_test.go?plain=1#L38) +[updating an existing tag: api-tag-removed, api-tag-added](../checker/check_api_tag_updated_test.go?plain=1#L64) diff --git a/go.mod b/go.mod index 135aec61..42b052f1 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( cloud.google.com/go v0.115.1 github.com/TwiN/go-color v1.4.1 github.com/getkin/kin-openapi v0.127.0 + github.com/iancoleman/strcase v0.3.0 github.com/oasdiff/telemetry v0.1.2 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.19.0 diff --git a/go.sum b/go.sum index 26b9c806..696bef36 100644 --- a/go.sum +++ b/go.sum @@ -26,6 +26,8 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/invopop/yaml v0.3.1 h1:f0+ZpmhfBSS4MhG+4HYseMdJhoeeopbSKbq5Rpeelso= diff --git a/scripts/get_tested_ids.sh b/scripts/get_tested_ids.sh new file mode 100755 index 00000000..69c1ed3a --- /dev/null +++ b/scripts/get_tested_ids.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +if [[ $1 == "lines" ]]; then + grep -nRE --exclude-dir=localizations,localizations_src "// (CL|BC): .*: .*-.*" checker/* | cut -d":" -f1,2,5 +elif [[ $1 == "diff" ]]; then + diff --side-by-side <(grep -nRE --exclude-dir=localizations,localizations_src '// (CL|BC): .*: .*-.*' checker/* | cut -d: -f5 | tr , '\n' | awk '{$1=$1};1' | sort -u) <(cat checker/localizations_src/en/messages.yaml | sed '/# warnings/q' | cut -d":" -f1 | sort -n) +elif [[ $1 == "all" ]]; then + cat checker/localizations_src/en/messages.yaml | sed '/# warnings/q' | cut -d":" -f1 | sort -n +else + grep -nRE --exclude-dir=localizations,localizations_src '// (CL|BC): .*: .*-.*' checker/* | cut -d: -f5 | tr , '\n' | awk '{$1=$1};1' | sort -u +fi