From 22ca3ced63cb65fc20507da29c68755f8fc7c022 Mon Sep 17 00:00:00 2001 From: Dave Shanley Date: Sat, 19 Nov 2022 09:36:50 -0500 Subject: [PATCH] discovered a bug in content changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switching machines, I can’t use this laptop for any real work. Signed-off-by: Dave Shanley --- test_specs/burgershop.openapi-modified.yaml | 13 ++++++++++--- what-changed/what_changed_test.go | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/test_specs/burgershop.openapi-modified.yaml b/test_specs/burgershop.openapi-modified.yaml index 04c2da1..9bf1e5b 100644 --- a/test_specs/burgershop.openapi-modified.yaml +++ b/test_specs/burgershop.openapi-modified.yaml @@ -122,6 +122,10 @@ paths: /burgers/{burgerId}: get: callbacks: + someCallback: + $ref: '#/components/callbacks/BurgerCallback' + niceCallback: + $ref: '#/components/callbacks/BurgerCallback' burgerCallback: $ref: '#/components/callbacks/BurgerCallback' operationId: locateBurger @@ -136,6 +140,9 @@ paths: "200": description: A tasty burger for you to eat. Wide variety of products to choose from content: + application/xml: + schema: + type: int application/json: schema: $ref: '#/components/schemas/Burger' @@ -146,10 +153,10 @@ paths: summary: A tasty treat from the sea value: name: Filet-O-Fish - numPatties: 1 + numPatties: 2 links: ListBurgerDressings: - operationId: listBurgerDressings + operationId: listBurgerDressingsOhMy parameters: dressingId: 'something here' description: 'Try the ketchup!' @@ -167,7 +174,7 @@ paths: "500": description: Unexpected error. Sorry. content: - application/json: + application/xml: schema: $ref: '#/components/schemas/Error' examples: diff --git a/what-changed/what_changed_test.go b/what-changed/what_changed_test.go index cdfba85..ee5ea51 100644 --- a/what-changed/what_changed_test.go +++ b/what-changed/what_changed_test.go @@ -22,8 +22,8 @@ func TestCompareOpenAPIDocuments(t *testing.T) { modDoc, _ := v3.CreateDocument(infoMod) changes := CompareOpenAPIDocuments(origDoc, modDoc) - assert.Equal(t, 21, changes.TotalChanges()) - assert.Equal(t, 3, changes.TotalBreakingChanges()) + assert.Equal(t, 28, changes.TotalChanges()) + assert.Equal(t, 5, changes.TotalBreakingChanges()) }