From 7ab7edf6e6d32a1b3e65de35bc0cdf1b0f5cf6d0 Mon Sep 17 00:00:00 2001 From: Beppe Catanese Date: Fri, 1 Dec 2023 16:32:36 +0100 Subject: [PATCH] Update to support OpenAPI 3.1.0 --- pom.xml | 2 +- .../tweesky/cloudtools/codegen/PostmanV2GeneratorTest.java | 6 +++--- src/test/resources/Basic.yaml | 2 +- src/test/resources/BasicJson.json | 2 +- src/test/resources/BasicVariablesInExample.yaml | 2 +- src/test/resources/JsonWithCommasInJsonExample.json | 2 +- src/test/resources/MgmtApi.json | 2 +- src/test/resources/SampleProject.yaml | 6 +++--- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index 3f0106e..d31e886 100644 --- a/pom.xml +++ b/pom.xml @@ -169,7 +169,7 @@ UTF-8 - 7.0.1 + 7.2.0-SNAPSHOT 1.0.0 4.13.2 7.8.0 diff --git a/src/test/java/com/tweesky/cloudtools/codegen/PostmanV2GeneratorTest.java b/src/test/java/com/tweesky/cloudtools/codegen/PostmanV2GeneratorTest.java index 53eeaae..760921d 100644 --- a/src/test/java/com/tweesky/cloudtools/codegen/PostmanV2GeneratorTest.java +++ b/src/test/java/com/tweesky/cloudtools/codegen/PostmanV2GeneratorTest.java @@ -290,7 +290,7 @@ public void testComponentExamples() throws IOException, ParseException { TestUtils.assertFileExists(path); // verify response body comes from components/examples TestUtils.assertFileContains(path, "\"name\": \"Example request for Get User\""); - TestUtils.assertFileContains(path, "\"raw\": \"{\\n \\\"id\\\" : 777,\\n \\\"firstName\\\" : \\\"Alotta\\\",\\n \\\"lastName\\\" : \\\"Rotta\\\",\\n "); + TestUtils.assertFileContains(path, "\"raw\": \"{\\n \\\"id\\\": 777,\\n \\\"firstName\\\": \\\"Alotta\\\",\\n \\\"lastName\\\": \\\"Rotta\\\",\\n "); } @Test @@ -457,7 +457,7 @@ public void testJsonExampleIncludingValueWithCommas() throws IOException, ParseE Path path = Paths.get(output + "/postman.json"); TestUtils.assertFileExists(path); // check value with commas within quotes - TestUtils.assertFileContains(path, "\\\"acceptHeader\\\" : \\\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\\\""); + TestUtils.assertFileContains(path, "\\\"acceptHeader\\\": \\\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\\\""); } @Test @@ -505,7 +505,7 @@ public void testGeneratedVariables() throws IOException, ParseException { Path path = Paths.get(output + "/postman.json"); TestUtils.assertFileExists(path); - TestUtils.assertFileContains(path, "\\\"createDate\\\" : \\\"{{$guid}}\\\""); + TestUtils.assertFileContains(path, "\\\"createDate\\\": \\\"{{$guid}}\\\""); } diff --git a/src/test/resources/Basic.yaml b/src/test/resources/Basic.yaml index 09089b3..a0ae036 100644 --- a/src/test/resources/Basic.yaml +++ b/src/test/resources/Basic.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: 3.1.0 info: title: Basic version: '1.0' diff --git a/src/test/resources/BasicJson.json b/src/test/resources/BasicJson.json index 2058bc4..2a27f22 100644 --- a/src/test/resources/BasicJson.json +++ b/src/test/resources/BasicJson.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "contact" : { "name" : "Beppe Catanese", diff --git a/src/test/resources/BasicVariablesInExample.yaml b/src/test/resources/BasicVariablesInExample.yaml index 9785214..2c354eb 100644 --- a/src/test/resources/BasicVariablesInExample.yaml +++ b/src/test/resources/BasicVariablesInExample.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: 3.1.0 info: title: BasicExample version: '1.0' diff --git a/src/test/resources/JsonWithCommasInJsonExample.json b/src/test/resources/JsonWithCommasInJsonExample.json index f7ee7af..25942bc 100644 --- a/src/test/resources/JsonWithCommasInJsonExample.json +++ b/src/test/resources/JsonWithCommasInJsonExample.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "description" : "Sample API", "title" : "Basic", diff --git a/src/test/resources/MgmtApi.json b/src/test/resources/MgmtApi.json index 6378375..3b8a3c9 100644 --- a/src/test/resources/MgmtApi.json +++ b/src/test/resources/MgmtApi.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.1.0", "servers" : [ { "url" : "https://management-test.adyen.com/v3" diff --git a/src/test/resources/SampleProject.yaml b/src/test/resources/SampleProject.yaml index fda1171..69a79b7 100644 --- a/src/test/resources/SampleProject.yaml +++ b/src/test/resources/SampleProject.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: 3.1.0 info: title: Sample project version: '1.0' @@ -105,10 +105,10 @@ paths: type: integer examples: a: - value: a + value: 1 summary: a summary b: - value: b + value: 2 summary: b summary name: userId in: path