diff --git a/checker/check_response_property_one_of_updated_test.go b/checker/check_response_property_one_of_updated_test.go index a354717c..ccf31286 100644 --- a/checker/check_response_property_one_of_updated_test.go +++ b/checker/check_response_property_one_of_updated_test.go @@ -9,7 +9,7 @@ import ( "github.com/tufin/oasdiff/load" ) -// CL: adding 'oneOf' schema to the response body or response body property +// BC: adding 'oneOf' schema to the response body or response body property is breaking func TestResponsePropertyOneOfAdded(t *testing.T) { s1, err := open("../data/checker/response_property_one_of_added_base.yaml") require.NoError(t, err) @@ -26,7 +26,7 @@ func TestResponsePropertyOneOfAdded(t *testing.T) { { Id: checker.ResponseBodyOneOfAddedId, Args: []any{"#/components/schemas/Rabbit", "200"}, - Level: checker.INFO, + Level: checker.ERR, Operation: "GET", Path: "/pets", Source: load.NewSource("../data/checker/response_property_one_of_added_revision.yaml"), @@ -35,7 +35,7 @@ func TestResponsePropertyOneOfAdded(t *testing.T) { { Id: checker.ResponsePropertyOneOfAddedId, Args: []any{"#/components/schemas/Breed3", "/oneOf[#/components/schemas/Dog]/breed", "200"}, - Level: checker.INFO, + Level: checker.ERR, Operation: "GET", Path: "/pets", Source: load.NewSource("../data/checker/response_property_one_of_added_revision.yaml"), @@ -44,7 +44,7 @@ func TestResponsePropertyOneOfAdded(t *testing.T) { { Id: checker.ResponsePropertyOneOfAddedId, Args: []any{"subschema #2: Dark brown types", "/oneOf[#/components/schemas/Fox]/breed", "200"}, - Level: checker.INFO, + Level: checker.ERR, Operation: "GET", Path: "/pets", Source: load.NewSource("../data/checker/response_property_one_of_added_revision.yaml"), diff --git a/checker/rules.go b/checker/rules.go index 6e356c5a..99321f76 100644 --- a/checker/rules.go +++ b/checker/rules.go @@ -385,9 +385,9 @@ func GetAllRules() BackwardCompatibilityRules { newBackwardCompatibilityRule(ResponseBodyMinLengthDecreasedId, ERR, ResponsePropertyMinLengthDecreasedCheck, DirectionResponse, LocationBody, ActionDecrease), newBackwardCompatibilityRule(ResponsePropertyMinLengthDecreasedId, ERR, ResponsePropertyMinLengthDecreasedCheck, DirectionResponse, LocationProperties, ActionDecrease), // ResponsePropertyOneOfUpdated - newBackwardCompatibilityRule(ResponseBodyOneOfAddedId, INFO, ResponsePropertyOneOfUpdated, DirectionResponse, LocationBody, ActionAdd), + newBackwardCompatibilityRule(ResponseBodyOneOfAddedId, ERR, ResponsePropertyOneOfUpdated, DirectionResponse, LocationBody, ActionAdd), newBackwardCompatibilityRule(ResponseBodyOneOfRemovedId, INFO, ResponsePropertyOneOfUpdated, DirectionResponse, LocationBody, ActionRemove), - newBackwardCompatibilityRule(ResponsePropertyOneOfAddedId, INFO, ResponsePropertyOneOfUpdated, DirectionResponse, LocationProperties, ActionAdd), + newBackwardCompatibilityRule(ResponsePropertyOneOfAddedId, ERR, ResponsePropertyOneOfUpdated, DirectionResponse, LocationProperties, ActionAdd), newBackwardCompatibilityRule(ResponsePropertyOneOfRemovedId, INFO, ResponsePropertyOneOfUpdated, DirectionResponse, LocationProperties, ActionRemove), // ResponsePropertyTypeChangedCheck newBackwardCompatibilityRule(ResponseBodyTypeChangedId, ERR, ResponsePropertyTypeChangedCheck, DirectionResponse, LocationBody, ActionChange), diff --git a/docs/BREAKING-CHANGES-EXAMPLES.md b/docs/BREAKING-CHANGES-EXAMPLES.md index b4a0cbbe..991c8caa 100644 --- a/docs/BREAKING-CHANGES-EXAMPLES.md +++ b/docs/BREAKING-CHANGES-EXAMPLES.md @@ -4,6 +4,7 @@ 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 'oneOf' schema to the response body or response body property is breaking](../checker/check_response_property_one_of_updated_test.go?plain=1#L12) [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) @@ -174,7 +175,6 @@ These examples are automatically generated from unit tests. [adding 'anyOf' schema to the request body or request body property](../checker/check_request_property_any_of_updated_test.go?plain=1#L12) [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 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)