diff --git a/core/src/test/java/org/openapitools/openapidiff/core/ParameterDiffTest.java b/core/src/test/java/org/openapitools/openapidiff/core/ParameterDiffTest.java index 6e4cd9303..06947ea55 100644 --- a/core/src/test/java/org/openapitools/openapidiff/core/ParameterDiffTest.java +++ b/core/src/test/java/org/openapitools/openapidiff/core/ParameterDiffTest.java @@ -88,4 +88,10 @@ public void issue458ExclusiveMinimumTrueRemoved() { assertOpenApiChangedEndpoints( "issue-458-integer-limits_11.yaml", "issue-458-integer-limits_13.yaml"); } + + @Test + public void issue488RenameParameterAddAndRemoveParameterReturnFalse() { + assertOpenApiChangedEndpoints( + "issue-488-1.json", "issue-488-2.json"); + } } diff --git a/core/src/test/resources/issue-488-1.json b/core/src/test/resources/issue-488-1.json new file mode 100644 index 000000000..22e0009dd --- /dev/null +++ b/core/src/test/resources/issue-488-1.json @@ -0,0 +1,98 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Test-API", + "description": "Testdescription", + "version": "v1" + }, + "paths": { + "/api/v1/test": { + "get": { + "tags": [ + "TestTag" + ], + "summary": "Retrieve a list Test objects", + "description": "Usage with testId parameter is recommended.", + "parameters": [ + { + "name": "testId", + "in": "query", + "description": "rename of prop before", + "schema": { + "type": "string" + } + }, + { + "name": "dateFrom", + "in": "query", + "description": "Searches documents with creation date equal or younger specified timestamp", + "schema": { + "type": "string" + } + }, + { + "name": "dateTo", + "in": "query", + "description": "Searches documents with creation date equal or older than specified timestamp", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TestDTO" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + } + } + } + } + }, + "components": { + "schemas": { + "TestDTO": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": true + }, + "Timestamp": { + "type": "string", + "format": "date-time" + }, + "Test": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + } + }, + "securitySchemes": { + "BearerAuth": { + "type": "apiKey", + "description": "Fill in your acquired bearer token here, must be like 'Bearer TOKEN_HERE'", + "name": "Authorization", + "in": "header" + } + } + }, + "security": [ + { + "BearerAuth": [ ] + } + ] +} \ No newline at end of file diff --git a/core/src/test/resources/issue-488-2.json b/core/src/test/resources/issue-488-2.json new file mode 100644 index 000000000..463e210c7 --- /dev/null +++ b/core/src/test/resources/issue-488-2.json @@ -0,0 +1,98 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Test-API", + "description": "Testdescription", + "version": "v1" + }, + "paths": { + "/api/v1/test": { + "get": { + "tags": [ + "TestTag" + ], + "summary": "Retrieve a list Test objects", + "description": "Usage with testId parameter is recommended.", + "parameters": [ + { + "name": "testIdWillBreak", + "in": "query", + "description": "rename of prop after", + "schema": { + "type": "string" + } + }, + { + "name": "dateFrom", + "in": "query", + "description": "Searches documents with creation date equal or younger specified timestamp", + "schema": { + "type": "string" + } + }, + { + "name": "dateTo", + "in": "query", + "description": "Searches documents with creation date equal or older than specified timestamp", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TestDTO" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + } + } + } + } + }, + "components": { + "schemas": { + "TestDTO": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": true + }, + "Timestamp": { + "type": "string", + "format": "date-time" + }, + "Test": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + } + }, + "securitySchemes": { + "BearerAuth": { + "type": "apiKey", + "description": "Fill in your acquired bearer token here, must be like 'Bearer TOKEN_HERE'", + "name": "Authorization", + "in": "header" + } + } + }, + "security": [ + { + "BearerAuth": [ ] + } + ] +} \ No newline at end of file